Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

At what times should I use "==" and "~=" when I script?

I've never really understood what to do with == and ~=

It seemed necessary for some stuff, but the only time I knew I had to use those is when I asked someone what was wrong with the script. I would like to know when to use these so I don't always have to have a friend tell me when.

1 answer

  • Equals to (or ==) means if one value is the same as another value.
  • Not equal to (or ~=) means if one value is not the same as another value.

If we have these three values:

a = 1
b = 2
c = 1

Using these operations in a sort of sentence may help.

a == c -- because 1 is equal to 1
a ~= b -- because 1 is not equal to 2

Hope this helps!

This discussion is preserved as it was. New answers, comments, and votes are closed.