(I dont know if I am just being dumb or what. I have searched around and not found any fixes.)
Hey, for some reason my countdown timer will randomly go from 29 days to 1 day to 20 seconds?
What am I doing wrong here?
local enddate = 1587775270
while require(game.ReplicatedStorage.Modules.WaitControl).Wait(1) do
local between = enddate-game.ReplicatedStorage.Events.PremiumEvents.GetTime:InvokeServer()
local days = math.floor(between/86400)
between = between - (days*86400)
local hours = math.floor(between/3600)
between = between - (hours*3600)
local mins = math.floor(between/60)
between = between - (mins*60)
local seconds = between
if string.len(tostring(days)) == 1 then
days = "0"..days
else
days = tostring(hours)
end
if string.len(tostring(hours)) == 1 then
hours = "0"..hours
else
hours = tostring(hours)
end
if string.len(tostring(mins)) == 1 then
mins = "0"..mins
else
mins = tostring(mins)
end
if string.len(tostring(seconds)) == 1 then
seconds = "0"..seconds
else
seconds = tostring(seconds)
end
script.Parent.Text = days..":"..hours..":"..mins..":"..seconds
end