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.
--runs code as soon as user clicks the button
I just have one question: what condition are you trying to meet?