generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Make a value 1 if its 0

Previous Thread :: Next Thread 
parkiet3 is not online. 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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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 is not online. Argelius
Joined: 19 Jul 2010
Total Posts: 4047
20 Dec 2014 11:21 AM
if not value then value=1 end
Report Abuse
parkiet3 is not online. parkiet3
Joined: 16 Jul 2011
Total Posts: 832
20 Dec 2014 11:24 AM
ok thx, im gonna try that
Report Abuse
RA2lover is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image