Codecombat - Any advice for dangerous key

The code runs but the dog just sits there.

The event message is "gold"

cool thank you ///////////////////

huh there are still errors

on lines 5-8

pet.findNearestByType("blahblahblah")

it should just be

pet.findByType("blahblahblah")

Hey, try this code:

# https://codecombat.com/play/level/dangerous-key
# Listen to the paladin and fetch the right key.

def onHear(event):
    # The pet can find the paladin and keys.
    paladin = pet.findNearestByType("paladin")
    goldKey = pet.findNearestByType("gold-key")
    silverKey = pet.findNearestByType("silver-key")
    bronzeKey = pet.findNearestByType("bronze-key")
    # If event.speaker is the paladin:
    if event.speaker == paladin:
        # If event.message is "Gold":
        if event.message == "Gold":
            # The pet should fetch the gold key.
            pet.fetch(goldKey)
        # If event.message is "Silver":
        if event.message == "Silver":
            # The pet should fetch the silver key.
            pet.fetch(silverKey)
        # If event.message is "Bronze":
        if event.message == "Bronze":
            # The pet should fetch the bronze key.
            pet.fetch(bronzeKey)

pet.on("hear", onHear)

P.S. if this is helpful, mark as solution.

Please don’t just post solutions (escpecially from github); he isn’t even using python.

This is not from github…