Usual Day error python

while True:
    enemy = hero.findNearestEnemy()
    if enemy and enemy.type == "munchkin":
        hero.attack(enemy)
    item = hero.findNearestItem()
    if "Gold Coin":
        hero.moveXY(itemx = itemx.pos.x, itemy = itemy.pos.x)


last line is the error how do I fix it? :frowning_face_with_open_mouth:

That is one weird code… :flushed:
First of all, you have to read the comments more carefully. It explicitly tells you the item.type must be coin, not Gold Coin. Second, you aren’t comparing anything, or checking if there’s really an item available to collect. Third, why are you defining a variable inside a function argument? Just do hero.moveXY(item.pos.x, item.pos.y)

I honestly didn’t know. :sweat_smile: I think reading might help. :slightly_smiling_face:

sorry about that:slightly_smiling_face:20charicters

I’m 12 btw .lol 20 characters

dude dont give out personal info online