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
I noticed two problems, I will put a comment beside each one.
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)]:Clone() --if you don't clone it the map will be gone when you destroy it 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 wait(1) --you weren't waiting at all so it just skipped right through this 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
In line 30 you start the while loop but you don't have a wait(1) in there so basically it will instantly make roundtime = 0 because there is not wait in the loop
You did not add a "wait(1)" into the loop. Do this:
while roundtime > 0 do m.Text = "Time until next round " .. roundtime roundtime = roundtime - 1 wait(1) end