I have a code which checks for parts in region. But it only works with ~= and not ==. What is the difference between these two?
✓ ANSWER ACCEPTED
What does ~= actually mean and what is the difference from ==?
2 answers
✓ Accepted answer
~= is "does not equal." so.
if 3 ~= 5 is true because 3 does not equal 5. read more about it here https://developer.roblox.com/articles/Conditional-Statements-in-Lua
~= "Not equal comparator"
Example:
if 1 ~= 0 then
print("1 Is not equal 0")
end
if 1 == 1 then
print("1 Is equal 1")
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
== means EQUALS, so if 3 == 5 is not true because 3 is not 5
Thank you.