parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
|
| 20 Dec 2014 11:16 AM |
when a value reaches 0, i want it to be 1.
Is there a fast way to do this, I thought something like this existed: local var = ... or ...
Please Help me! |
|
|
| Report Abuse |
|
|
|
| 20 Dec 2014 11:18 AM |
Check if it is 0, and if it is, set it to 1.
Or you can do
Value = Value <= 0 and 1 or Value |
|
|
| Report Abuse |
|
|
Argelius
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 4047 |
|
|
| 20 Dec 2014 11:21 AM |
| if not value then value=1 end |
|
|
| Report Abuse |
|
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
| |
|
RA2lover
|
  |
| Joined: 09 Nov 2008 |
| Total Posts: 1254 |
|
|
| 20 Dec 2014 11:30 AM |
| in lua - unlike most other languages, not number only returns true if number==nil, so that won't help it. |
|
|
| Report Abuse |
|
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
|
| 20 Dec 2014 11:33 AM |
| ^ yeah i was thinking the same, but Jarod's works |
|
|
| Report Abuse |
|
|