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

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);

1 Like
#2

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

The pet should say something. pet.say

1 Like
#3

1 Like
#4

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

1 Like
#5

Delete hero.say(“alarm”)

1 Like
#6

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

1 Like
#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: