local ex = game.Workspace.example --BoolValue
function PrintSomething()
print("Worked")
end
while wait() do
if ex.Value == true then
PrintSomething()
end
end
Problem
Right now I'm trying to figure out the most efficient way to properly check if a condition has changed or a better way to say it is if a certain requirement has been meant for code to run. The code above isn't supposed to be anything complicated; I made it to find different ways to check for changes, but the way I did it is really the only way I've really understood how to do it.
And it doesn't really work. So, is there different methods in checking for conditions?
Question
How can I check for certain conditions/requirements and have code run in response?

2 comments
Getpropertychangedsignal.
you can use "ex.Changed:Connect()" to tell when the value has changed, then check if it meets the requirements