while wait(1) do
local timeVal = script.Parent.Parent.Buy.TimeToOwn.Value
timeVal = timeVal - 1
script.Parent.Parent.timeLeft.ui.lbl.Text = convert(timeVal)
if timeVal == 0 then
script.Parent.Parent.timeLeft.ui.lbl.Text = 'Time Up!'
end
end
And yet it will only do it once and not repeat until it is finished.
is timeVal supposed to counting down? If so, then the problem is that you’re setting the value of timeVal to whatever the value in TimeToOwn is at the start of each loop, which you aren’t changing anywhere in this loop. So unless you are reducing TimeToOwn by 1 every second in another script somewhere, timeVal will always be the same value every loop.