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

How do i make a countdown timer?

A timer that counts down the seconds. Example:

The zombies will attack in 3

That counts down in seconds?

Please help.

-mastersniper7399

3 answers

✓ Accepted answer

Use loops like for do or repeat

Repeats

Time = 3 --How many seconds until round starts or something.
local h = Instance.new("Hint", workspace) --The hints are so players can see what how much time there is on the top of their screen. If you are using GUIs that could work too.
repeat
h.Text = "The zombies are attacking in "..Time
wait(1) --One second at a time
Time = Time -1
until Time <= 0
--Rest of the script

for do

local h = Instance.new("Hint", workspace) --The hints are so players can see what how much time there is on the top of their screen. If you are using GUIs that could work too.
for i = 3,0,-1 do --start at 3 seconds end at 0 seconds and take away one second at a time
h.Text = "The zombies are attacking in "..i
wait(1)
end
--Rest of script

Repeats and for loops.

2 comments

0

Thank you!

0

You're welcome! You could replace the hint with a gui for a much cleaner look.

timervalue = --timer text object here that you pass strings to timeron = true

while timeron do timervalue = timervalue - 1 wait(1) end

that should work

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