How do I check if a property isn't equal to something

So basically I want to make a script that checks if a TextLabel’s Text is NOT equal to something. I know that to check if the text is equal to something, you’d do:

local TextLabel = script.Parent
if TextLabel.Text == "Example" then
end

I however, want something like this, but the script would instead check if the text is not “Example”. How would I do this?

local TextLabel = script.Parent
if TextLabel.Text ~= “Example” then
end

this should work :slight_smile:

This should stop you from making any other mistakes: Programming in Lua : 3.2

1 Like

Yep. If I could put two solutions I would mark your thing as a solution too. I already know every other operator, just didn’t know this one because I self-taught myself lua and never have seen anything like this in a script. Thank you!

Just for the future you can check equal if something is greater than or equal by >=
Less than or equal by <=
greater than>
less than<
and obviously you have == or ~=