If you are checking if this is equal to that in a loop, most likely something must’ve been changed. So I would use the .Changed event to check so it is not constantly running. Then you can add your if statement to check and continue with the rest of your code.
There are several listeners you could use so that you don’t have to constantly check/wait for a condition to be true. For instance, GUI buttons have an Activated listener so that you can run code right when the user clicks the button, rather than having to constantly check whether the user’s mouse is inside the button.
Example:
guiButton.Activated:Connect(function()
--runs code as soon as user clicks the button
end)
I just have one question: what condition are you trying to meet?
It depends on the case, but generally this == that means an arbtruary case because I always knew using while true loops are bad so this is just a general question.