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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Is there a difference between saying nil and 0?

Previous Thread :: Next Thread 
OzzyBlox is not online. OzzyBlox
Joined: 04 Nov 2009
Total Posts: 14166
01 Jan 2012 09:11 AM
Say:

Brick.Transparency = nil

and

Brick.Transparency = 0
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
01 Jan 2012 09:12 AM
I don't think there's a difference.
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
01 Jan 2012 09:15 AM
I tested, there isn't a difference.
Report Abuse
Leeav is not online. Leeav
Top 100 Poster
Joined: 07 Sep 2006
Total Posts: 1905
01 Jan 2012 09:16 AM
Nil, is just used in a sense of sort of imagination, while 0 has a value. You can still do arithmetic operations with 0, but not with nil, because it is really, undefined.
Report Abuse
Leeav is not online. Leeav
Top 100 Poster
Joined: 07 Sep 2006
Total Posts: 1905
01 Jan 2012 09:17 AM
Example: print(1*0) --Results in 0, print(1*nil) -- Can't be done
Report Abuse
brickitr0n is not online. brickitr0n
Joined: 22 Aug 2008
Total Posts: 62
01 Jan 2012 12:02 PM
0 is a number, while nil is nothing whatsoever.

An arithmetic problem such as:
2 * 0
Would result in 0, but a problem such as:
2 * nil
Will come up inconclusive.

In the Transparency problem you mentioned, 0 is the default value for transparency. Since nil is not an acceptable value for Transparency, it will default to 0. Same thing will happen in Reflectance, etc.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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