Hello!
I made a code using the "or" operator and there's something about this I don't understand.
Here's an example. I have an Int Value which has "1" in its value. With the code below I'd think it should not trigger when it has "1", only when it's 0 or 2.
But, it does print "Hello", even when the value is 1. Can someone explain why this happens? I don't want the code to trigger when it's 1, only when it actually says 0 or 2.
Code I used in this example:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local test = ReplicatedStorage:WaitForChild("Test") -- IntValue with "1" in Value.
if test.value == 0 or 2 then
print("hello")
end

2 comments
Better explanation
Great in-depth answer. Thank you for this!