Value will not be updated due to it just being a number
you could solve this issue by constantly getting the current value by indexing it:
Value = workspace.Values.IntO
if Value.Value ~= 2 then
repeat wait(5) print(".") until Value.Value == 2
end
print("End")
script.Parent.ClickDetector.MaxActivationDistance = 10
While the above solution provided by @GetStyled will work, Remember that it will mean that it will only update every 5 Seconds and will also be constantly running in the background which could Yield the thread.
A better way around this would be
local Val = workspace.IntO
Val.Changed:Connect(function()
print("Value Changed!")
if Val.Value == 2 then
print("Got it!")
end
end)