# Defeat the ogres and cure the hero.
# The pet is your only hope.
def onSpawn(e):
while True:
enemy = pet.findNearestByType("munchkin")
if enemy and pet.isReady("chase"):
pet.chase(enemy)
# Find and fetch a "potion":
item = hero.findNearestItem()
if item.type == "potion":
pet.fetch(item)
# Assign "onSpawn" handler on the "spawn" event
pet.on("spawn", onSpawn)
You gotta use the pet to find the item in your onSpawn function because the hero is disabled.
That was so close, this is so funny why r we racing to help someone!
Im not sure but i am striving to be a helpful user
Same, but I’m not exactly sure how, cuz it’s not a badge.
Where should I put the code?
Before you say if item.type == “potion”
Wat do u mean? 200000000000
Didn’t work you guys still have a chance.
Replace hero.findnearestItem()
with ‘potion = pet.findnearestByType(“potion”)’
to beat each other.
Then say if potion:
pet.fetch(potion)
Yay thank you. Endelord won
This isn’t a competition .-.
2 Likes