I want this script to Teleport all players to a part ('Spawner') which is located in Workspace, but this script goes by x,y,z CFrame, and i want this ('Spawner') CFrame, example of what i want is like,
local LPlr = game.Players.LocalPlayer Lplr.Character.HumanoidRootPart.CFrame = game.Workspace.Spawner.CFrame
But, instead of my player i want to make this script to teleport everyone there, instead of (0,50,0) I want the ('Spawner') CFrame.
function teleAll(x, y, z) local pos = Vector3.new(x, y, z) for _, plr in pairs(game:GetService("Players"):GetPlayers()) do if plr.Character then plr.Character:MoveTo(pos) teleAll(0, 50, 0)
Note: The script does work.
A simple way of saying this is, I want all players teleported to a brick called Spawner in workspace.
Hello, killerbrasko2002!
This script I made was made in this editor so if it's messy my apologies.
for i,v in pairs(game.Players:GetPlayers()) do workspace:WaitForChild(v.Name).HumanoidRootPart.CFrame = workspace:WaitForChild("Spawner").CFrame end
local players = game:GetService("Players") function teleAll(x, y, z) for _, plr in pairs(players:GetPlayers()) do if plr.Character then plr.Character:MoveTo(x, y, z) end end end teleAll(workspace.Spawner.Position)