I’m not getting any error, my soldiers just won’t attack
Code
# You can use findNearestEnemy() on your soldiers to get their nearest enemy instead of yours.
while True:
friends = hero.findFriends()
# Use for-loop and for each friend:
for friend in friends:
# If they see an enemy then command to attack.
enemy = hero.findNearestEnemy()
if enemy and friend.distanceTo(enemy) < 15:
hero.command(friend, "attack", enemy)
x = friend.pos.x + 5
y = friend.pos.y
# Command to move east by small steps.
hero.command(friend, "move", {'x':x,'y':y})