I was following a tutorial and a certain part of it doesn’t work. The main script works but it fails to teleport the player. Here’s the script
local intermissionLength = 7
local InRound = game.ReplicatedStorage.InRound
local LobbySpawn = game.Workspace["Spectating Spawn"]
local Status = game.ReplicatedStorage.Status
local blueSpawn = game.Workspace["Blue Spawn"]
local redSpawn = game.Workspace["Red Spawn"]
InRound.Changed:Connect(function()
wait(1)
if InRound.Value == true then
for _, player in pairs(game.Players:GetChildren()) do
local char = player.Character
char.HumanoidRootPart.CFrame = blueSpawn.CFrame
end
else
for _, player in pairs(game.Players:GetChildren()) do
local char = player.Character
char.HumanoidRootPart.CFrame = LobbySpawn.CFrame
end
end
end)
local function roundTimer()
while wait() do
for i = intermissionLength, 0, -1 do
InRound.Value = false
wait(1)
Status.Value = "Intermission: ".. i .." seconds left!"
end
for i = roundLength, 0, -1 do
InRound.Value = true
wait(1)
Status.Value = i .." seconds left!"
end
end
end
spawn(roundTimer)
There's also a local script that changes a Label GUI:
local Status = game.ReplicatedStorage.Status
local TimerDisplay = script.Parent.TimerDisplay
Status.Changed:Connect(function()
TimerDisplay.Text = Status.Value
end)