Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how do you teleport everyone in the server to a different position?

I have recently started scripting and i want to know how to teleport everyone to a certain place, if you can, please send code and explain how it works ,Thank you

1 answer

✓ Accepted answer

Here's a script that should work:

local tpPart = workspace.TpPart

for _,player in pairs(game.Players:GetPlayers()) do
	player.Character.HumanoidRootPart.CFrame = tpPart.CFrame
end

We used a for i,v in pairs() loop to loop through all the players in the server, then we're accessing their character's HumanoidRootPart and changing its CFrame to the TpPart's CFrame.

1 comment

0

CFrame is the Coordinate Frame of a specified part.

This discussion is preserved as it was. New answers, comments, and votes are closed.