Equal or not?

FirstSymbol = 11 if FirstSymbol ~= 11 or FirstSymbol ~= 12 then print("Not equal to 11 or 12") else print("Its 11 or 12") end 

This executes ‘Not equal to 11 or 12’. Why?

It works with a single expression like this:

FirstSymbol = 11 if FirstSymbol ~= 11 then print("Not equal to 11") else print("Its 11") end

This is because the first expression is checking both contingencies, so since FirstSymbol isn’t equal to 12, the expression is valid. You want to use “and” instead of “or” in the first one. 

Thanks Alex, that did the trick :slight_smile:

This is because the first expression is checking both contingencies, so since FirstSymbol isn’t equal to 12, the expression is valid. You want to use “and” instead of “or” in the first one. 

Thanks Alex, that did the trick :slight_smile: