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: When to use = and ==?

Previous Thread :: Next Thread 
AmiracIe is not online. AmiracIe
Joined: 13 Feb 2014
Total Posts: 1362
14 Aug 2014 06:40 PM
Subject is my question.
Report Abuse
L0cky2013 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
14 Aug 2014 06:41 PM
= is to define a variable, == returns a bool telling whether the two things being compared are equal to eachother.
print(5==7) >false
print(7==7) >true
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
14 Aug 2014 06:42 PM
= is for setting a variable

a = 7
b = "WHEE"
c = {1,2,3}

== is for testing equality

print(1+1 == 2)
>true

print(1+1 == 100000)
>false

-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::]
Report Abuse
RecoveryManager is not online. RecoveryManager
Joined: 01 Oct 2011
Total Posts: 3982
14 Aug 2014 06:42 PM
Prertty sure that = is for situations like transparency = false

and == is for ex. if reloading == false
/\
| pretty sure if errors if only 1 = is used
Report Abuse
AmiracIe is not online. AmiracIe
Joined: 13 Feb 2014
Total Posts: 1362
14 Aug 2014 06:45 PM
Thanks for the quick answer! I would of consulted the wiki, but the search tool isn't very effective :(
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
14 Aug 2014 07:04 PM
1 = 2 is used when you want to set 1 to equal 2, so 1 is now 2.

1 == 2 is used when checking to see if 1 equals two.

If you look closely, I don't give a crap.
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