Can someone edit this script so when all players die the round restarts.
local roundLength = 5
local intermsssionlength = 10
local InRound = game.ReplicatedStorage.InRound
local Status = game.ReplicatedStorage.Status
local Lobby = game.Workspace.LobbySpawn
local GameAreaSpawn = game.Workspace.GameAreaSpawn
InRound.Changed:Connect(function()
if InRound.Value == true then
for _, player in pairs(game.Players:GetChildren()) do
local char = player.Character
char.HumanoidRootPart.CFrame = GameAreaSpawn.CFrame
end
else
for _, player in pairs(game.Players:GetChildren()) do
local char = player.Character
char.HumanoidRootPart.CFrame = Lobby.CFrame
end
end
end)
local function roundTimer()
while wait() do
for i = intermsssionlength, 1, -1 do
InRound.Value = false
wait(1)
Status.Value = "Intermission: ".. i .." secounds left!"
end
for i = roundLength, 1, -1 do
InRound.Value = true
wait(1)
Status.Value = "Game: ".. i .." secounds left!"
end
end
end
spawn(roundTimer)