Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What does ~= actually mean and what is the difference from ==?

Asked by 5 years ago

I have a code which checks for parts in region. But it only works with ~= and not ==. What is the difference between these two?

2 answers

Log in to vote
2
Answered by 5 years ago

~= 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

0
== means EQUALS, so if 3 == 5 is not true because 3 is not 5 User#22889 0 — 5y
0
Thank you. Thepoint13 99 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

~= "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

Answer this question