What is the script meant to do?
The script should teleport the player to another location while the “game” is running. It does this fine the first time but dying just makes the script not work. Here is an example:
Here is the problematic part of the script:
inRound.Changed:Connect(function()
if inRound.Value == true then
while wait() do
for i, player in pairs(game.Players:GetChildren()) do
local char = player.Character
local spawnlocation = math.random(1,5)
local charparts = char:GetChildren()
for i, charpart in pairs(charparts) do
charpart.Touched:Connect(function(otherPart)
if otherPart.Name == "TPpart" then
charpart.Parent.HumanoidRootPart.CFrame = roundSpawns[spawnlocation].CFrame
end
end)
end
end
end
end
end)