So I put a part in Workspace, then I put a NumberValue inside of the part.
I put this script in the NumberValue:
while true do if script.Parent.Value == 0 then print("It's zero") wait(5) end end
I did this hoping that when the NumberValue changed to 0 that it would print "It's Zero" but when i run the game i get the error "Game Script timeout".
Change the script to this:
script.Parent:GetPropertyChangedSignal('Value'):Connect(function() if script.Parent.Value == 0 then print('It\'s Zero') end end)
Now it will only run the code when the value is changed. Just be sure that when testing, go into server mode and edit the value there, or make a script to control that!