Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

[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.costOf("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.


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]


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