|
| 12 Sep 2010 09:58 PM |
I think you admins, should add to the roblox wiki script section. I've always wanted to learn more about nils. So please, if you could do this, please add a nil tutorial on the roblox wiki. Thank you.
- XxchainsXx2477 |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2010 09:59 PM |
nil = nothing
Example
game.Workspace.glennmiles.MaxHealth = nil |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2010 10:03 PM |
| Nil is a noninitialized value, or lack of a value, that is blank and equal to nothing. Math cannot be performed on nil or anything equivalent to nil, because nothing, unlike 0, is not a numerical value. When an object is deleted, using the :Remove() function, it is removed from the game completely by setting its parent to nil. Unless the object is referenced, it cannot be recovered. |
|
|
| Report Abuse |
|
|
|
| 12 Sep 2010 10:04 PM |
p = Instance.new("Part") -- We will create a new grey brick p.Parent = game.Workspace -- The part (a grey brick) has a parent, game.Workspace p.Parent = nil -- The part now has no parent (and so it disappears). p.Parent = game.Workspace -- part still exists because it is referenced by 'p' p.Parent = nil -- part disappears again (for it has no parent) p = nil -- part is no longer referenced by anything, so it gets picked up by the removed. |
|
|
| Report Abuse |
|
|
|
| 14 Sep 2010 09:17 PM |
How about, nils like,
if e.g ~= nil then -------------------- if e.g == nil then -------------------- Is there anymore nils like that? I just want to make sure, if e.g ~= nil then, means if e.g is there?
and if e.g == nil then, means it's not there? Just making sure, cause i get confused... |
|
|
| Report Abuse |
|
|
|
| 14 Sep 2010 09:20 PM |
| Beep Explained it pretty well and sont bump old posts. |
|
|
| Report Abuse |
|
|