Wild Horses python


#1

i need help on how do you find a friendly unit
here is my code. thank you

while True:
self.findNearestFriend()
if horse:
x1 = horse.pos.x - 7
x2 = horse.pos.x + 7

    if x1 >= 1:
        
        hero.moveXY(x1, horse.pos.y)
    elif x2 <= 79:
        hero.moveXY(x2, horse.pos.y)
    distance = hero.distanceTo(horse)
    if distance <= 10:
        hero.say("Whoa
        hero.moveXY(27, 54)
        hero.moveXY(43, 21)

#2

#try:horse= self.findNearest( ???)


#3

thank you the horse= self.findNearest( hero.findFriends()) worked!