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
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: What does ~= nil mean?

Previous Thread :: Next Thread 
doneyes is not online. 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 is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
30 Jun 2012 09:19 AM
[ Content Deleted ]
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
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 is not online. 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
thek00lkid is not online. thek00lkid
Joined: 18 Jun 2011
Total Posts: 2778
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 is not online. 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
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