Hi,
This game has four team colors Red, Blue, Green, and Yellow. When the players initially login they are appropriately assigned to a team and its matching color spawn. The game is cycled with a round timer. When the timer reaches 0 then the players are CFramed back to the spawn points. However, when the round is up (timer zero) all of the players are respawned to the red spawn point (which happens to be the 1st of 4 spawns I added to studio) even though I can see the players are all still assigned to their original team color in the player properties.
In this script the player is respawned when a boolval is changed to false. I cannot figure out how to call out the original SpawnLocation color that the player logged into originally. So that when the boolval “inRound” is false the player is transported back to their original team SpawnLocation instead of the red one. I think that since I’m not killing the players is why Studio doesn’t know to spawn them back but I’m not sure that’s an efficient way to handle this?
inRound.Changed:Connect(function()
if inRound.Value == false then
for i, player in pairs(game.Players:GetChildren()) do
local char = player.Character
char.HumanoidRootPart.CFrame = GameAreaSpawn.CFrame
end
end
end)
Thanks,
D