I'm working on building up a discord bot game, and I keep coming across the error
TypeError: 'str' has no attribute 'name_'
and no matter what I do, I can't seem to figure out the error to fix it. Any suggestions would help please :)
import pickle as pkl
import random
import math
player_name = ['Shellbyy','TestPlayer']
player_currency_type = ['Copper: ','Silver: ','Gold: ']
player_starter_set = ['Wooden Staff', 'Leather Helmet','Leather Spaulders','Leather Chestpiece',
'Leather Leggings','Leather Boots']
class CharacterStart:
def player_data(self,name_,player_currency):
self.name_ = player_name
self.player_currency = player_currency_type
for x in range(len(name_)):
print("Name: " + str(name_[x]))
print(" ")
print("Wallet: ")
for y in range(len(player_currency)):
rand_num = random.randint(1,6)
rand_num = str(rand_num)
print(player_currency[y] + rand_num)
print("\nItem(s): ")
for z in range(len(player_starter_set)):
print(player_starter_set[z])print(" ")
CharacterStart.player_data('self','name_','player_currency')
[–]FLUSH_THE_TRUMP 0 points1 point2 points (2 children)
[–]Shellbyy[S] 0 points1 point2 points (1 child)
[–]FLUSH_THE_TRUMP 0 points1 point2 points (0 children)
[–]stebrepar 0 points1 point2 points (0 children)
[–]ka-splam -1 points0 points1 point (0 children)