Code: Select all
# Player Stats
def self():
self.inventory = {}
self.current_pickaxe = None
< /code>
Ich versuche "self.current_pickaxe" zu verwenden, um Minen sowie XP zu entsperren. < /p>
def mine_resources(location):
global xp
# Check if the player has the required pickaxe
required_pickaxe = pickaxe_requirements[location]
if required_pickaxe and self.current_pickaxe != required_pickaxe:
print(f"You need a {required_pickaxe} to mine here.")
return
< /code>
Fehler hier: < /p>
AttributeError: 'function' object has no attribute 'current_pickaxe'