Guard Dog. Help plz


#1

Guys, I dont know how to solve this task.

You can’t help the peasants across the river.

But, your pet can!

Teach your wolf to be a guard dog.

def alarm(event):
while True:
# Pets can find enemies, too.
enemy = pet.findNearestEnemy()
# If there is an enemy:
if enemy:
hero.say(“message”)
# Then have the pet say something:

pet.on(“spawn”, alarm);


#2

The comment-instruction says # Then have the pet say something:

The pet should say something. pet.say


#3


#4

it doesn’t help. (((( I dont know how to solve.


#5

Delete hero.say(“alarm”)


#6

change hero.say(“message”) into pet.say(“message”).


#7

This problem has been solved and left alone for six months. Try not to revive dead threads in the future, but thanks for extending a helping hand to the CodeCombat community. :slight_smile: