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)