Hello! I need help, and it’s concerning this script
local newYear = os.time({year = 2022, month = 10, day = 9, hour = 9, min = 17, sec = 0})
while wait(1) do
local currentTime = os.time()
local timeDiff = newYear - currentTime
local d = math.floor(timeDiff/60/60/24)
local h = string.format("%0.2i", math.floor((timeDiff - (d*60*60*24))/60/60))
local m = string.format("%0.2i", math.floor((timeDiff - (d*60*60*24) - (h*60*60))/60))
local s = string.format("%0.2i", timeDiff - (d*60*60*24) - (h*60*60) - (m*60))
local formattedTime = h .. ":" .. m .. ":" .. s
script.Parent.CountdownText.Text = timeDiff <= 0 and "00:00:00" or formattedTime
if timeDiff <= 0 then
for _,v in pairs(game.Players:GetPlayers()) do
v:Kick("test")
end
break
end
end
I’ve seen countless people use this script and it works flawlessly, but it doesn’t work for me.
Basically, when the timer reaches zero, its supposed to kick all the players in all servers, then break the loop. When I do play it and test it out, it just doesn’t work. It just loops the timer again from 00:00:00:00, to 23:23:59:59, and I don’t know what to do
Idk if I maybe bugged it, or just simply broke it. If anyone can help me, thank you in advance!
