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

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.

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