How do i make a Count Down timer?

How do I make a countdown timer GUI?

By countdown timer, are you referring to counting down to a specific date, or counting down for example 60 seconds?

use a for loop and change the text of your gui every iteration

Specific Date. I want to do Day/Hours/Minutes/Seconds

Ah, use os.time

https://developer.roblox.com/en-us/api-reference/lua-docs/os

Didn’t test this but this should work.

local countdown = placeholder
while task.wait() do
wait(1)
countdown = countdown - 1
timer.Text = tostring(countdown)
end
local function createTimer(_time)
	local hint = Instance.new"Hint"
	hint.Parent = workspace
	for count = _time, 0, -1 do
		task.wait(1)
		hint.Text = "Time Remaining: "..count
	end
	task.wait(1)
	hint:Destroy()
end

createTimer(5)
1 Like