Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do I prevent a variable from going into the negatives? (Please Notice)
- Clydedtoob
- Scratcher
54 posts
How do I prevent a variable from going into the negatives? (Please Notice)
Pretty much sums it up. I need to know for a game.
-Clydedtoob
- helloworldbyeworld
- Scratcher
1000+ posts
How do I prevent a variable from going into the negatives? (Please Notice)
Put this if-statement right after every instance you change the variable:
if <(the variable) < (0)> then
set [the variable v] to (0)
end
Helloworldbyeworld | 1200+ posts
Have a great day
- Clydedtoob
- Scratcher
54 posts
How do I prevent a variable from going into the negatives? (Please Notice)
Thank you!
-Clydedtoob
- Discussion Forums
- » Help with Scripts
- » How do I prevent a variable from going into the negatives? (Please Notice)