Soldier command error

for friend in self.findFriends():
        if friend.type == "soldier":
            enem = friend.findNearestEnemy()
            # If there's an enemy, command her to attack.
            if hero.canCast("sacrifice"):
                soldier = hero.findNearest( hero.findByType( "soldier" ) )
                if <= hero.maxHealth - 300:
                    if soldier:
                        hero.cast("sacrifice",soldier,hero )
            if enem:

It shows that I can’t command the opposing side’s soldier. How am I commanding the opposing soldier this way?

Well, all I know is that when your opponent uses raiseDead(), necromancer units automatically join the opponent’s team (even if they were on your side while they were alive).

1 Like

Well, when you use raise dead ability the corpse which got raised goes into your team, not the opponent’s team


Not exactly, raise dead will raise all units, no matter what side they are on. Sorry, i read your post worng, you are right, i was just anwering the worng question.

the error strikes again. this time I lost because I have twilight glasses on which makes me see the other side’s soldiers

I tried your code and it worked fine.

did you do it against someone called Thomas Twinklestar? Now it seems as if the error is coming when I battle him, not anybody else.

No, let me try agianst him. What clan

is Thomas in, to duel him.

You are one of the only people i cant beat, your code is preety good. :grinning:

I get killed again. By Mr-borges this time (The previous ones included Lord Cyber. They aren’t giving me the error anymore, but this is getting ridiculous).