I got some code already, but I see some errors and don't know why. For my 30 sec countdown, when it reaches zero I want all the players to change to red colored team then die. For my 2 min countdown, when it reaches zero I want them to change to blue colored team then die. I did this, but it does not really work. Can you please help my script and tell me if I put it in workspace or where? And tell me if its a local script or script? I get really confused. Thank you!
local seconds = 120 -- 120 seconds, meaning 2 minutes. local seconds2 = 30 -- My 30 sec one local timer = script.Parent -- Timer object! seconds = ((seconds > 1 and seconds) or 1) function startTimer() local begin = tick() while tick() < begin + seconds do local diff = (math.floor(tick()) - (begin + seconds)) timer.Text = math.floor(seconds / 60) .. ":" .. (seconds % 60) wait(0.1) end for k,v in pairs(game:service("Players"):GetPlayers()) do if v.Character and v.Character:FindFirstChild("Humanoid") then v.Character:FindFirstChild("Humanoid").Health = 0 end end function startTimer2() local begin = tick() while tick() < begin + seconds do local diff = (math.floor(tick()) - (begin + seconds)) timer.Text = math.floor(seconds2 / 60) .. ":" .. (seconds2 % 60) wait(0.1) end for k,v in pairs(game:service("Players"):GetPlayers()) do if v.Character and v.Character:FindFirstChild("Humanoid") then v.Character:FindFirstChild("Humanoid").Health = 0 end end while true do startTimer() startTimer2() end