Ummm not much to say other than i want to teleport all Players in the global table called _G.Players but if i insert it there
for _, player in pairs (_G.Players) do if player and #spawns > 0 then local torso = player.Character:WaitForChild('HumanoidRootPart') . . .
it will give me a Error that Character is a nil value
but if I do it like this
for _, player in pairs (game.Players:GetPlayers()) do if player and #spawns > 0 then local torso = player.Character:WaitForChild('HumanoidRootPart')
Everything works without errors but i dont want that. because it would teleport all Players that are currently in the game. I just want to teleport the Players inside the _G.Players Table. Any solution for that? Here is my whole teleport script if you need it
--Teleport tributs local spawns = map:WaitForChild("Spawns"):GetChildren() for _, player in pairs (game.Players:GetPlayers()) do if player and #spawns > 0 then local torso = player.Character:WaitForChild('HumanoidRootPart') local allspawns = math.random(1, #spawns) local randomspawn = spawns[allspawns] if randomspawn and torso then table.remove(spawns, allspawns) torso.CFrame = CFrame.new(randomspawn.Position + Vector3.new(0,2,0)) end end end