Need help for the goalkeeper


I explain my problem, i’m on the goalkeeper desert. And my script have error :

    friends = self.findNearest(self.findFriends())
    ball = self.findByType("ball")[0]
    if ball.pos.y < 42 and ball.pos.y > 36:
        self.command("Burk", "move", {'y': ball.pos.y})
    if ball.pos.y < 35 and ball.pos.y > 29:
        self.command("Millicent", "move", {'y':ball.pos.y})

i need help my error was on the ball pos i think. Thanks


Hello, Rubin, and welcome. Please format your code properly according to the FAQ. I’ve done it for you this time, but do so yourself in the future.

You need to command peasants to move to an {x,y} position. You only command them to move to a {y}` position.