[SOLVED]Timber Guard Python Help

By messaging them on discourse?

no jjust do

soldier = hero.findFriends(hero.findByType("soldier"))

ok I will try that.(20 chars)

It still gives me the same error as before, “Don’t know how to transform: Set”

hmm… why did you add while loops?

just do

for friend in hero.findFriends():
        if friend.type == "soldier":
            enemy = friend.findNearestEnemy()
            if enemy:
                hero.command(friend, "attack", enemy)
            else:
                x = friend.pos.x
                y = friend.pos.y
                hero.command(friend, "move", {'x': x + 5, 'y': y})

u dont nneed whiles

Let me try.(20 chars)

its way eziler and u dont need to use lengths andindexs

Ok I see my problem.

solved ???

Another error again.

You could use

In the for friend in friends: loop, nothing else

1 Like

And it should work after that

Ok thanks!(20 chars)

Have you completed the level?

Yes thanks for your help.(20 characters)

u forgot the curly brackets for the ommand soldier move part @Blaze_Fire1

Oh yay you solved it @Blaze_Fire1