I’m creating a round system, and everything is working well, except, when you are supposed to get teleported to the proper spawn, once you spawn, the round intermission starts up again. Here’s the code.
local Players = game:GetService("Players")
while true do
wait(0.01)
local PlayerCount = #Players:GetPlayers()
if PlayerCount < 1 then
for i, v in pairs(Players:GetChildren()) do
v.PlayerGui:WaitForChild("Intermission").Rounds.Text = "We need at least 2 players to initiate the intermission."
end
else
local countdown = 15
repeat
countdown -= 1
for i, v in pairs(Players:GetChildren()) do
v.PlayerGui:WaitForChild("Intermission").Rounds.Text = "The round will begin in "..countdown.." second(s)."
end
wait(1)
until countdown == 0
for i, v in pairs(Players:GetChildren()) do
v.PlayerGui:WaitForChild("Intermission").Rounds.Text = "The round is beginning!"
end
wait(3)
local Monster = Players:GetChildren()[math.random(1, PlayerCount)]
for i, v in pairs(Players:GetChildren()) do
if v.Name ~= Monster.Name then
v.CameraMode = Enum.CameraMode.LockFirstPerson
v.RespawnLocation = workspace.Spawns.Area1
else
v.RespawnLocation = workspace.Spawns.Monster
end
v:LoadCharacter()
v.RespawnLocation = workspace.Spawns.Lobby
v.PlayerGui:WaitForChild("Intermission").Rounds.Text = Monster.Name.." was selected as the monster!"
end
end
end
If it should help, all the spawns except lobby (the one I was at) are NOT neutral, and like i said, the GUI has ResetOnSpawn to false. WHat did I do wrong and what’s the solution?