|
| 12 Jun 2013 04:23 PM |
| I'm new to scripting and I want to try know all the commands. |
|
|
| Report Abuse |
|
|
robox44
|
  |
| Joined: 16 Sep 2008 |
| Total Posts: 737 |
|
|
| 12 Jun 2013 04:29 PM |
nil = no/nothing
So, if I say collide=nil
it means that what ever is colliding, well, won't collide.
or say if character=nil
means, the characters not there |
|
|
| Report Abuse |
|
|
T3XT
|
  |
| Joined: 25 Jul 2011 |
| Total Posts: 9233 |
|
|
| 12 Jun 2013 05:26 PM |
"nil" is essentially the phrase for nothing.
If something is equal to nil, it's not there. If something is not equal to nil, it is there. If you set something equal to nil,it will disappear. It's a similar usage to the keyword "void" in standard C++. |
|
|
| Report Abuse |
|
|
T3XT
|
  |
| Joined: 25 Jul 2011 |
| Total Posts: 9233 |
|
|
| 12 Jun 2013 05:27 PM |
For more information:
http://wiki.roblox.com/index.php/Nil |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2013 05:31 PM |
Object = nil Is /essentailly/ the same as Object:Destroy() |
|
|
| Report Abuse |
|
|
iIikeyou
|
  |
| Joined: 07 Mar 2012 |
| Total Posts: 1659 |
|
|
| 12 Jun 2013 05:37 PM |
| That's incorrect. Setting a *variable* to nil does not affect the actual instance within RBX.Lua, it simply won't associate the variable with it's previous value when called. Using the destroy method on an instance change's it's parent to nil and fully locks the metatable so it can't be accessed from scripts with a normal security level, as well as with all it's descendants. |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2013 05:39 PM |
/essentailly/ <<<<----
There's a reason I put emphasis on that word. |
|
|
| Report Abuse |
|
|
iIikeyou
|
  |
| Joined: 07 Mar 2012 |
| Total Posts: 1659 |
|
| |
|
|
| 12 Jun 2013 05:46 PM |
I knew I wasn't entirely correct, so that's why I said essentially. I'm simple trying to make it easier to understand. Do you think someone who doesn't know what 'nil' is will understand this?:
"Setting a *variable* to nil does not affect the actual instance within RBX.Lua, it simply won't associate the variable with it's previous value when called. Using the destroy method on an instance change's it's parent to nil and fully locks the metatable so it can't be accessed from scripts with a normal security level, as well as with all it's descendants." |
|
|
| Report Abuse |
|
|
iIikeyou
|
  |
| Joined: 07 Mar 2012 |
| Total Posts: 1659 |
|
|
| 12 Jun 2013 05:48 PM |
If you don't know what nil is, why are you telling him what nil is? nil is nothing. |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2013 05:52 PM |
I do know what nil is, would you like me to explain my logic?
nil = nothing Destroying something makes it nothing. Hence, destroying something is virtually the same as setting it to nil, which is nothing. |
|
|
| Report Abuse |
|
|
iIikeyou
|
  |
| Joined: 07 Mar 2012 |
| Total Posts: 1659 |
|
|
| 12 Jun 2013 06:06 PM |
local part=Instance.new('Part',workspace) part.Name='lolpart' print(part) --> lolpart part=nil print(part) --> nil print(workspace.lolpart) --> lolpart
Setting a variable to nil does NOT do the same thing. Setting it's parent to nil is /close/ to the /remove/ method. pls goway |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2013 06:18 PM |
| I'm not talking about variables, I'm talking about objects! |
|
|
| Report Abuse |
|
|
iIikeyou
|
  |
| Joined: 07 Mar 2012 |
| Total Posts: 1659 |
|
|
| 12 Jun 2013 06:20 PM |
| You can not set an instance to nil in RBX.Lua. Please learn more about your argument before fighting for it. |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2013 06:21 PM |
Oh. In that case, I'm wrong. Carry on. |
|
|
| Report Abuse |
|
|