Log In  

I'm doing this a lot through my games in loops and I feel like there should be a shorthand for it...?

a-=1
if a<=0 then a=0 end

And similar type of counting, etc...

P#41900 2017-06-23 20:37 ( Edited 2017-06-24 02:13)

What you want is min() or max(). Sum'n like

a=max(a-1,0)
P#41904 2017-06-23 22:13 ( Edited 2017-06-24 02:13)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 14:11:36 | 0.006s | Q:8