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 this mean in a script?

Previous Thread :: Next Thread 
Illusonist is not online. Illusonist
Joined: 29 May 2012
Total Posts: 8
17 Jun 2012 12:27 PM
if ~= nil
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
17 Jun 2012 12:32 PM
That's a syntax error.
Report Abuse
orangegreenblue is not online. orangegreenblue
Joined: 04 Sep 2010
Total Posts: 10906
17 Jun 2012 12:34 PM
If you do mean what does ~= mean then it means not.

-orangegreenblue, the Lua Noob
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
17 Jun 2012 12:36 PM
No, `not` means not. `~=` means not equal to.
Report Abuse
Illusonist is not online. Illusonist
Joined: 29 May 2012
Total Posts: 8
17 Jun 2012 01:07 PM
Thanks
Report Abuse
ScripterJQ is not online. ScripterJQ
Joined: 22 May 2012
Total Posts: 177
17 Jun 2012 01:23 PM
"not" can only be used for a boolean, and ~= can be used for multiple types, and like NXTBoy said... "~=" means not equal to.
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
17 Jun 2012 01:44 PM
(b ~= true) = (b = false)
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
17 Jun 2012 02:00 PM
@thecaptain97: Incorrect:

    theproblem = "something"

    if theproblem ~= true then
        print "Ok so far..."
    end
    if theproblem == false then
        print "But this never prints"
    end
Report Abuse
NXTBoy is not online. NXTBoy
Joined: 25 Aug 2008
Total Posts: 4533
17 Jun 2012 02:03 PM
@scripterjq:
> "not" can only be used for a boolean'

Also false. I can write the following, and use `not` on a non-object:

    if not workspace:FindFirstChild("XYZ") then ... end

In most cases, `not x` is equivalent to `x == false or x == nil`. Only when metatables are involved does that cease to be true.
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