what is the difference between one "=" and two "=". Do spaces matter in LUA coding? and last question. What does plr:LoadCharacter() mean, what does the two empty brackets do?
I know other people have answered most of these questions, but I'll try to give a more descriptive answer. If you use =, you're setting something to a value, like a variable. For example:
testVariable = 1 --This sets the variable (testVariable) to 1.
Use == if you're comparing two values. For example:
if testVariable == 1 then print("Hello!") end
Basically, we're seeing if testVariable is 1. If it is, then the output is "Hello!"
Okay another question. Do spaces matter in Lua? Most of the time, no. For example, it doesn't matter if you do this:
testVariable = 1
or this:
testVariable=1
But if you're trying to specify a part or something else:
--Let's say the name of the part is TestPart. game.Workspace.TestPart.CanCollide = false --This is valid game.Workspace.Test Part.CanCollide = false --This is invalid, because the game thinks the part it's looking for is called "Test Part", but that is non-existent.
Hope this helps, and happy coding!
Single = is an assignment to a variable (variable on the left, expression on the right)
Double == is the equality comparison operator, (a==b) evaluates to true or false.
You can't have spaces between the characters in ==, it will not be interpreted correctly.
"=" Is used to assign a value to something while "==" is used for comparing.
"==" is for checking something. "=" is for declaring something.
MyVariable = "Hello" if MyVariable == "Hello" then print("Your Variable is the same as "Hello".) end
= means equals == means equals to