[Solved] I'm stuck on cloud rip commander

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

Your while-loop is not increasing the soldierIndex, so you end up with an infinite loop.

2 Likes

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

thanks it wors now! i realis how someonmd can get that wrong