Help on Long Road level

I’m stuck on this level, i have a problem on line 13

the language is Python

here is the code:

# Move to the right.

# Complete this function:
def onSpawn(event):
    # Inside a while-true while True:
    while True:
        # Use hero.findNearestItem()
        # If there's an item:
        if item:
            # Use pet.fetch(item) to fetch the item.

# Use pet.on() to assign onSpawn to the "spawn" event
pet.on("spawn", onSpawn)
hero.moveXY(78, 35)

item is not defined. You need to define item.

item = hero.findNearestItem()
1 Like

thanks, it was my mistake, now it works

It’s okay, you can check out my guide about coco, it will help you

for sure :+1:, I’ll see your guide

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.