[Kinda Solved] Can't seem to get through Multiplayer Treasure Grove

My hero collects the first coin but after that he just stands there.

# Be the first to 100 gold!
# If you are defeated, you will respawn at 67% gold.
item = hero.findNearestItem()
itemPosition = item.pos
itemX = itemPosition.x
itemY = itemPosition.y
while True:
    #  Find coins and/or attack the enemy.
    # Use flags and your special moves to win!
    hero.moveXY(itemX, itemY)

@bagwagen, put all variables in the while true loop and after that, put

If item:

Thanks, now the only thing I need to do is to attack the enemy.

not exactly solved yet.

I think he knows the steps after that

place the enemy variable, then check if the enemy exists, then attack.