Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make a countdown timer?

Asked by 10 years ago

A timer that counts down the seconds. Example:

The zombies will attack in 3

That counts down in seconds?

Please help.

-mastersniper7399

3 answers

Log in to vote
2
Answered by 10 years ago

Use loops like for do or repeat

Repeats

1Time = 3 --How many seconds until round starts or something.
2local 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.
3repeat
4h.Text = "The zombies are attacking in "..Time
5wait(1) --One second at a time
6Time = Time -1
7until Time <= 0
8--Rest of the script

for do

1local 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.
2for i = 3,0,-1 do --start at 3 seconds end at 0 seconds and take away one second at a time
3h.Text = "The zombies are attacking in "..i
4wait(1)
5end
6--Rest of script

Repeats and for loops.

0
Thank you! mastersniper7399 15 — 10y
0
You're welcome! You could replace the hint with a gui for a much cleaner look. EzraNehemiah_TF2 3552 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

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

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

that should work

Log in to vote
0
Answered by 10 years ago

You requested, but a few people came to help you.

Answer this question