Mountain Mercenaries/ python/ error [Solved]

The duck helper thing is saying my target is a function and i don’t know how to fix that : /

while True:
    # Move to the nearest coin.
    coin = hero.findNearestItem()
    soldiers = hero.findFriends()
    soldier = hero.findNearestFriend()
    enemies = hero.findEnemies()
    
    # Use move instead of moveXY so you can command constantly.
    if coin:
        hero.move(coin.pos)
    # If you have funds for a soldier, summon one.
    if hero.gold > hero.costOf("soldier"):
        hero.summon("soldier")
        
    if enemies:
        
        # Loop oer all your soldiers and order them to attack.
        for soldier in soldiers:
            enemy = hero.findNearestEnemy
            hero.command(soldier, "attack", enemy)
            # Use the 'attack' command to make your soldiers attack
            #hero.command(soldier, "attack", enemy)

Error

just add 1 line

soldiers = hero.findFriends()

Add where? It is at the beginning I thought that was enough.

Oh I forgot that was there. Delete the line bellow

change this

into this

enemy = hero.findNearestEnemy()

Nevermind found out what i did wrong thank you @milton.jinich

Congrats! Please mark whichever post helped solve your problem.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.