doneyes
|
  |
| Joined: 21 Mar 2008 |
| Total Posts: 3466 |
|
|
| 30 Jun 2012 09:18 AM |
| I see ~= nil a lot when talking about players. I keep seeing it and have no idea what it is. |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
| |
|
|
| 30 Jun 2012 09:19 AM |
| ~= is the operator for "is not equal to". So you're checking if the player is not equal to nil. |
|
|
| Report Abuse |
|
|
doneyes
|
  |
| Joined: 21 Mar 2008 |
| Total Posts: 3466 |
|
|
| 30 Jun 2012 09:24 AM |
| So you put that on a while true do to keep checking that the name exists? So when it doesn't it does whatever? |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2012 09:41 AM |
| '~=' Is an operator meaning, not equal to. In other programming languages, it is often referenced as '!='. Nil means nonexistent, and this is the replaced value when an object is destroyed. Therefore, this term can be used to check the existence of an object. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 30 Jun 2012 11:16 AM |
"it is often referenced as !="
Not all programming languages are the same. . .
Also, if you don't like using ~= you can still use the not operator.
if game.Workspace:FindFirstChild("Part")~=nil then
Is same as
if not game.Workspace:FindFirstChild("Part") == nil then
|
|
|
| Report Abuse |
|
|