I want an event countdown that counts down minutes and hours till the date (July 1st). I currently only know how to make it countdown seconds.
How can I use os.time()
to make it countdown hours and minutes?
I have read the os.time document but I can’t figure it out.
My current code
local timeToStart = 1623712500
local timeToEnd = 1625144400
local timeLeft = game.Workspace.Billboard.Timeee.TimeLeft.Time
function liveEvent()
timeLeft.Text = "Countdown till release starting!!!"
end
while wait(1) do
local timeNow = os.time()
if timeNow >= timeToEnd then
break
end
if timeNow >= timeToStart then
print("Starting the live event!")
liveEvent()
break
else
print("Time till live event: "..(timeToStart-timeNow).." seconds")
timeLeft.Text = (timeToStart-timeNow).."!"
end
end
while wait(1) do
local timeNow = os.time()
if timeNow <= timeToEnd then
timeLeft.Text = (timeToEnd-timeNow).." seconds till release."
end
end
Does anybody know and can help me?