Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

(Stupid Question Time) How to restart this timer?

Ok so I'm excruciatingly stupid and cannot for the life of me figure out or find how to make this simple timer script reset. Fyi, it's meant to be a timer gui, and script.Parent.Parent.Time is an IntValue

local seconds = script.Parent.Parent.Time

script.Parent.Text = seconds.Value

for i = 1,seconds.Value do
	wait(1)
	seconds.Value = seconds.value - 1
	script.Parent.Text = seconds.Value
end

2 answers

✓ Accepted answer

Change the for loop to this:

for loop = 1, -0.1, -.01 do
				seconds.Value = loop
					wait(.05)
			end
end

What this does is it starts at 1 and ends at -0.1 and the increment is -0.1.

Don't just copy and paste this script, Change the values to what you need. Check if it works though :D.

1 comment

0

Thank you!

local seconds = script.Parent.Parent.Time

script.Parent.Text = seconds.Value

for i = 1,seconds.Value do
    wait(1)
    seconds.Value = seconds.value - 1
    script.Parent.Text = seconds.Value
end


while true do -- this should check if the time reaches 0 then it would go up again
if seconds.Value == 0 then
seconds.Value = 10
end
end

i hope this works for you.

This discussion is preserved as it was. New answers, comments, and votes are closed.