Im trying to get the players teleported to the certain location There is no error given in the console
local spawnLocation = game.Workspace:WaitForChild("Brick") local loadedSpawnLocation = spawnLocation:GetChildren() for i, v in pairs (game.Players:GetPlayers()) do local character = v.Character:FindFirstChild("HumanoidRootPart") wait(2) character.CFrame = loadedSpawnLocation.CFrame end
Thanks in advance
I believe this works, At least I hope so, as it works in my studio build. (an older version of the roblox studio)
local spawnLocation = game.Workspace:WaitForChild("Brick") local people = game.Players:GetPlayers() for i = 1,#people do people[i].Character.HumanoidRootPart.CFrame = spawnLocation.CFrame end
Explanation:
local people = game.Players:GetPlayers()
put this before the teleportation, as every-time the script for teleporting is ran, it checks all the players on the game at the time the script is run.
for i = 1,#people do
keeps checking for people to do the loop until theres none more to teleport.
people[i].Character.HumanoidRootPart.CFrame = spawnLocation.CFrame
teleports the person's RootPart CFrame to the spawnLocation CFrame.