ajdv
1
my game sase that the code works and there’s nothing wrong with it but it won’t work hears my code
while hero.gold > hero.costOf("soldier"):
hero.summon("soldier")
soldiers = hero.findFriends()
soldierIndex = 0
while (soldierIndex < len(soldiers)):
hero.command(soldiers, "move", {"x":50, "y":40})
hero.moveXY(50, 40)
1 Like
Serg
2
Your while-loop is not increasing the soldierIndex
, so you end up with an infinite loop.
2 Likes
ajdv
3
still not working it sase that Comand’s argumant minyon should have type until but got aray
hero.command(soldiers, “move”, {“x”:50, “y”:40})
soldiers is array, unit is soldiers[soldierIndex]
3 Likes
ajdv
5
thanks it wors now! i realis how someonmd can get that wrong