{SOLVED} Help with zero sum

it sase that moves argument pos should have type object but got type null hears my code

while True:
    enemies = hero.findEnemies()
    nearestEnemy = hero.findNearest(enemies)
    
    # Your hero can collect coins and summon troops.
    if hero.gold > hero.costOf("griffin-rider"):
        hero.summon("griffin-rider")
    if hero.gold > hero.costOf("paladin"):
        hero.summon("paladin")
        
    # She also commands your allies in battle.
    friends = hero.findFriends()
    for friend in friends:
        hero.command(friend, "attack", friend.findNearest(enemies))
    
    # Use your hero's abilities to turn the tide.
    coin = hero.findNearest(hero.findItems())
    hero.move(coin.Pos)
2 Likes

I believe it should be:

coin.pos & not coin.Pos

2 Likes

It doesn’t look like you are using this command in any way in the code.

2 Likes

thanks i won:slight_smile:

3 Likes

the hero.move(coin.pos) does not work

Make sure you put brackets at the end of hero.findItems. Like hero.findItems()
Danny

i got it now thanks…

and who is danny?..

Me, it’s my name. I use it at the end of my posts, don’t really know why, but I don’t like to just end them.

ok (20 characters)…