|
| 17 Oct 2012 07:00 PM |
'Nil' means that the subject in question does not exist, right?
Example;
while true do if Thread = nil then Thread.existence.value = false end |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 Oct 2012 07:06 PM |
its == nil
=: Set ==: Compare |
|
|
| Report Abuse |
|
|
|
| 17 Oct 2012 07:08 PM |
Well, first off you need two equal signs to ask if something is equal to another value, if Thread==nil then
Now, the 'Thread.existence.value=false' will not work, for Thread doesn't exist in the first place, so it can't have a value named existence in it.
And, for while true do loops, you must have some kind of wait in it
while wait(1)do -- the wait can replace the 'true' condition, since wait(1) won't return false because it exists. if not Thread then -- Same as ==nil in this case Instance.new("StringValue",game.Workspace).Name="Thread" end end |
|
|
| Report Abuse |
|
|
|
| 17 Oct 2012 07:10 PM |
| @wood, the op was asking if his definition of nil is true. You don't need to go all out on the thread. |
|
|
| Report Abuse |
|
|
|
| 17 Oct 2012 07:11 PM |
| I think that if you re-read my post, you'll find that I was asking you what 'nil' means, NOT to correct my example. |
|
|
| Report Abuse |
|
|
|
| 17 Oct 2012 07:11 PM |
| He was doing it wrong. In all fairness, it was fine to correct him. |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Oct 2012 07:13 PM |
nil is false, though, like in English, a condition will return true with a double negative for instance
if not nil then print('hi') end >hi
bewm
numbers can also return true/false on their own, without == to compare them 0 == false natural numbers (possibly negative integers) == true
allout |
|
|
| Report Abuse |
|
|
|
| 17 Oct 2012 07:14 PM |
print(nil==false)
Lua Learners - Elite |
|
|
| Report Abuse |
|
|