local Time = "N/A" while true do if script.Parent.Value == 0 then script.Parent.ClickDetector.MaxActivationDistance = 32 else Time = script.Parent.Value - 1 wait(1) script.Parent.Value = Time script.Parent.SurfaceGui.TextLabel.Text = Time end end
I see some things that I am able to fix up!
Here's the fixed code, let me know if it works!
local Time = 'N/A' local timestart = 30 --how many seconds it counts down from for i = timestart, 1, -1 do wait(1) Time = i script.Parent.Value = Time script.Parent.SurfaceGui.TextLabel.Text = Time end script.Parent.ClickDetector.MaxActivationDistance = 32
Also, if you're using a Server Script
then the TextLabel
's text will probably not update. Try handling everything related to GUIs via LocalScripts
.