-
What I want to achieve? A live countdown to a certain date.
-
What is the issue? It counts to the date that is not stated and it wrong configured like it shows that there are 78 hours left and a day has 24 hours only…
-
What solutions have you tried so far? I looked on the internet and asked other scripters and tried like 20 editions of the script.
local countdownGui = script.Parent
local countdownText = countdownGui:WaitForChild("CountdownText")
local day = os.time({year = 2021, month = 4, day = 4, hour = 11, min = 16, sec = 0})
while wait() do
local secondsBetween = os.difftime(day, os.time())
local seconds = secondsBetween % 60
local minutes = math.floor(secondsBetween % (6060) / 60)
local hours = math.floor(secondsBetween % (606024) / (6060))
local days = math.floor(secondsBetween % (60602430) / (6060*24))
local textString = days .. "d:" .. hours .. "h:" .. minutes .. "m:" .. seconds .. "s"
countdownText.Text = textString
if secondsBetween <= 0 then break end
end