For example, if there is a battle going on, I want a countdown gui that counts from two minutes to zero seconds. When it gets to zero, I want everyone to automatically change team then die. Next, I want another countdown gui that goes from 30 sec to 0 sec. When it reaches 0 sec, I want it to change team and die again. Then I want it to repeat on and on. So far I got this:
local seconds = 120 -- 120 seconds, meaning 2 minutes.
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
startTimer()
I tried it, but it seems like it's not working. How can I improve this?

2 comments
????????????? what r u doing
confusion