[Solved] I'm stuck on cloud rip commander


#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)

#2

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


#3

still not working it sase that Comand’s argumant minyon should have type until but got aray


#4

hero.command(soldiers, “move”, {“x”:50, “y”:40})

soldiers is array, unit is soldiers[soldierIndex]


#5

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