Mushroom noise help

I don’t know what is wrong but
it says that it cannot read property ‘start’ of undefined
here is my code

def onSpawn (event):
potion = pet.findNearestByType(“potion”)
pet.fetch(potion)
gold-key = pet.findNearestByType(“gold-Key”)
pet.fetch(gold-key)
pass

skeleton = pet.findNearestByType(“skeleton”)
pet.on(“spawn”, onSpawn)

while True:
if skeleton.health > 0:
hero.attack(skeleton)
else:
hero.moveXY(31, 38)

Try looking at the hints section it was a huge help when i tried it

what language are you using

python or javascript

on js def = var. its python

I’m using the code language python

ok lets see…

which line exactly does it say is wong or undefined

i meant to say wrong

def onSpawn (event):

potion = pet.findNearestByType("potion")

if potion:
    pet.fetch(potion)

key = pet.findNearestByType("gold-key")

if key:
    pet.fetch(key)
pass

skeleton = pet.findNearestByType(“skeleton”)
pet.on(“spawn”, onSpawn)

while True:
if skeleton.health > 0:
hero.attack(skeleton)
else:
hero.moveXY(31, 38)

its my code. and he work.

it show none of the lines wrong or undefined

thank you!!! you both

you are welcome. goodl ukcon the next level

i meant to say luck.

gold-key – how do you think it’s one or two variables names? :wink:

1 Like

find quite or loud .

It won’t let me start, saying I need the pets when I already own them.

Have you equipped your pets?

1 Like

I own them but it says to subscribe to unlock in the loadout page

Then you do not have a pet. You must be subscribed to beat the level Dread Door, to unlock the Wolf Pet.

1 Like