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


#1

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


#2

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.


#3

hero.coin should be hero.gold


#4

Is this a glitch?


How???
Another glitch?


#5

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


#6

I still don’t understand. :sob:


#7

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


#8

I try but still don’t working


#9

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


#10

The screenshot was not mine just now.


#11

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


#12

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


#13

have you made the changes suggested above?


#14

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


#15

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


#16

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


#17

I used Nalfar for this level


#18

My okar once started spawning skeletons and scattershoting enemies.