Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Guard Dog. Help plz

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:
# Then have the pet say something:

pet.on(“spawn”, alarm);

1 Like

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

The pet should say something. pet.say

1 Like

1 Like

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

1 Like

Delete hero.say(“alarm”)

1 Like

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

1 Like

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: