Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to teleport all players to a location in game?

Asked by 6 years ago

I need help making a script to where players get teleported to a location in my game. If you know a script please help me.

0
for loop R_alatch 394 — 6y

3 answers

Log in to vote
0
Answered by 6 years ago
local Location = CFrame.new(0, 50, 0)

for i, v in pairs(game.Players:GetPlayers()) do
    v.Character:SetPrimaryPartCFrame(Location)
end
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Are you talking about a teleport IN GAME, or a teleport to another place?

In case of a place in game, here you go.

Put this inside a locascript, then put the localscript inside StarterGear.


player = game.Players.LocalPlayer repeat wait() until player.Character.HumanoidRootPart humpart = player.Character.HumanoidRootPart humpart.CFrame = CFrame.new() -- Position Of A Part
Log in to vote
0
Answered by 6 years ago

This is probably the easiest way (I didn't test it with FilteringEnabled):

_Players = game.Players:GetChildren()

for x = 1, #_Players do
    _Players[x].Character:MoveTo(Vector3.new( Position ))
end

Answer this question