Im having an issue with this script where it does not display the gui after the round is over and I have been trying lots of things to get it to work but it doesnt. The script only displays the gui once but not every time
local roundlength = 15
local intermissionlength = 0
local InRound = game.ReplicatedStorage.InRound
local Status = game.ReplicatedStorage.Status
local Camera = workspace.CurrentCamera
local function Teleport(Location)
if not workspace.Spawns:FindFirstChild(Location) then return end
for _, player in pairs(game.Players:GetPlayers()) do
local char = player.Character or player.CharacterAdded:wait()
char.HumanoidRootPart.CFrame = workspace.Spawns[Location].CFrame
end
end
InRound.Changed:Connect(function()
if InRound.Value == false then
Teleport("LobbyTP")
end
end)
local function roundTimer()
while wait() do
for i = intermissionlength, 0, -1 do
InRound.Value = false
wait(1)
Status.Value = "TIME: ".. i ..""
end
for i = roundlength, 0, -1 do
InRound.Value = true
wait(1)
Status.Value = "TIME: ".. i ..""
if i <= 0 then
Ended()
end
end
end
end
spawn(roundTimer)
function Ended()
for _, player in pairs(game.Players:GetPlayers()) do
pcall(function()
player.PlayerGui.EndGui.GameInfo.Visible = true
player.PlayerGui.EndGui.CameraHandler.Disabled = false
task.delay(5,function()
player.PlayerGui.EndGui.CameraHandler.Disabled = true
player.PlayerGui.EndGui.GameInfo.Visible = false
end)
end)
end
end