Im honestly lost it just doesnt work and i dont know which one to use
= works like this:
local Name = "Test" -- = is used to set a variable
== works like this:
local Name = "Test" if script.Parent.Name == Name then -- == is used to check if two variables match each other print('match') end
you use = when declaring variables or modifying them and you use == in conditional statements
You use == in if statements to check if something is worth exactly that but when you use = then you are setting the value. For example.
Local debounce = false -- Here you are declaring a variable by using = function hello() if debounce == false then -- here we are looking if debounce is equal to false or not. end end
The "==" sign is used for comparisons
The "=" sign is used to define variables and all that jazz.
a = fat
would work, but
a == fat
would not work unless you're comparing in a print or in an until.
but, you can do
a = fat --lets just say fat was defined before, now "a" points to the variable "fat" if a == fat then --since a points to "fat", it will almost always return true, unless you do something dumb with the a/fat variables print(a == fat) --since a == fat is correct, the statement a == fat will return true. end
Marked as Duplicate by xAtom_ik, User#20388, DeveloperSolo, and cabbler
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?