【Level:Underground Business ]Help I can't move after i collect 300 coin

Here is my code. I don’t understand why i can’t move after i collect 300 coin…anyone can help please

Local variable definitions do not transfer from one function to the next. You’ve defined coin in your onSpawn() function but not in your while True loop. When the code gets to the conditional, if hero.coin > 300:, it has no idea what coin is.

hero.coin should be hero.gold

Is this a glitch?

Another glitch?

Regarding the first screenshot, what’s on the first 28 lines?

I still don’t understand. :sob:

The first screenshot starts at line 29. What is before it? Line 1 through 28.

I try but still don’t working

What’s not working? All I’m asking you to do is scroll up and take another screenshot.

The screenshot was not mine just now.

Sorry about that. My post was directed at @I_can_rob_you. I’m conversing with the wrong person.

That’ok . Could you help me with this code?

have you made the changes suggested above?

1 Like

I don’t know how to define the coins owned by hero. is hero.gold? i have tried. but…

1 Like

Using the code posted in your screenshot, just make the change suggested by kyay10 in your while True loop.

1 Like

my code. (Don’t want to give away solution)

I used Nalfar for this level

My okar once started spawning skeletons and scattershoting enemies.