I don't really get it :P
✓ ANSWER ACCEPTED
What does == and ~= mean?
2 answers
✓ Accepted answer
The == Operator
The == operator is the operator for comparing equivalent values.
val1 == val2 - if val1 is equivalent to val2.
local val1 = 4
local val2 = 2 * 2
if val1 == val2 then
print('Equivalent!')
end
The above code would print Equivalent! because val1 is equivalent to val2.
The ~= Operator
The ~= operator is the comparing non-equivalent values! The exact opposite of ==.
val1 ~= val2 - if val1 is not equivalent to val2.
local val1 = 4
local val2 = 1
if val1 ~= val2 then
print('Not Equivalent!')
end
The above code would print Not Equivalent! because val1 is not equivalent to val2.
Both == and ~= are used in if or repeat - until functions. == means 'is equal to', and ~= means 'is NOT equal to'.
Example:
if Value == true then
--Code
elseif Value ~= true then
--Other code
end
2 comments
0
Hmm, I see. Thanks for the fast reply bud :D
0
'if' isn't a function, it's a statement. 'repeat - until' isn't a function, it's a loop.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
and "=" will change the value of something.