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

Buddy's Name please help

# We need to know the name of our new pet.

# Use this function as a handler for "hear" events on pet.
def onHear(event):
    # Don't change this function.
    pet.say("Meow Purr Meow")
    pet.say("Purr Purr")
    pet.say("Meow Purr Meow Meow")

# Use the pet.on(eventType, eventHandler) method
# It must be after "pet.on".
hero.say("What's your name, buddy?")
hero.say("Could you repeat it?")

what did i do wrong


Use the pet.on(eventType, eventHandler) method

eventType is "hear"
eventHandler is onHear


how do i do that? i have never done that


pet.on(“hear”, onHear)


thanks it worked im loving this


Have you played “Go fetch” and “Backwoods Buddy”? Those levels are placed before “Buddy’s name” and they show how to use it. Also, don’t forget about Hints.

1 Like