Mushroom noise help


#1

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)


#2

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


#3

what language are you using


#4

python or javascript


#5

on js def = var. its python


#6

I’m using the code language python


#7

ok lets see…


#8

which line exactly does it say is wong or undefined


#9

i meant to say wrong


#10

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.


#11

it show none of the lines wrong or undefined


#12

thank you!!! you both


#13

you are welcome. goodl ukcon the next level


#14

i meant to say luck.


#15

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


#16

find quite or loud .


#17

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


#18

Have you equipped your pets?


#19

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


#20

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