Whenever it's time to countdown, it just says the round is already over. I'm not sure why, but it's quite annoying.
local maps = game.ServerStorage:FindFirstChild("Maps"):GetChildren()
local m = Instance.new("Message", workspace)
while wait(1) do
m.Text = "Starting a new round!"
wait(3)
m.Text = "Choosing a random map..."
wait(3)
local chosenmap = maps[math.random(1, #maps)]
chosenmap.Parent = workspace
m.Text = "The map is " .. chosenmap.Name .. " by " .. chosenmap.Creator.Value .. "!"
wait(3)
m.Text = "Teleporting players..."
wait(3)
for i, v in pairs(game.Players:GetPlayers()) do
if v.Character.Humanoid.Health > 0 and v ~= nil then
local spawns = chosenmap:FindFirstChild("Spawns"):GetChildren()
v.Character:MoveTo(spawns[i].Position)
end
end
local roundtime = 60
while roundtime > 0 do
m.Text = "Time until next round " .. roundtime
roundtime = roundtime - 1
end
m.Text = "The time is up!"
wait(3)
for i, v in pairs(game.Players:GetPlayers()) do
if v.Character.Humanoid.Health > 0 and v ~= nil then
v:LoadCharacter()
end
end
end
