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

[SOLVED] Mushroom Noise

I don’t know what is wrong with my code, I am on the level Mushroom Noise in the desert.

# Defeat the skeleton and open the chest.

def onSpawn (event):
    # Pet should find the health potion (type is "potion"): 
    potion = pet.findNearestByType("potion")
    # and fetch it:
    # Pet should find the gold key (type is "gold-key"):
    item = pet.findNearestByType("goldkey")
    # and fetch it:

# Pet can find more than just items:
skeleton = pet.findNearestByType("skeleton")
pet.on("spawn", onSpawn)

while True:
    if > 0:
        hero.moveXY(31, 38)

what is your problem?

never mind, i encountered the worst enemy of coding. AKA misspelling. In the searching for a gold key line there is supposed to be a “-” in between gold and key. I fixed it in the next minute! Thanks for trying to help though.

no problem