How to change a players position

Alright guys, I am trying to make a MiniGame and I cant figure out how to tp all players to a set location. Your assistance would help a lot!

2 Likes

Put this Script in ServerScriptService:

local Players = game:GetService(“Players”)

local players = Players:GetPlayers()

local function TeleportPlayers(Part)
for _, player in pairs(players) do
if player.Character then
local HumanoidRootPart = player.Character:FindFirstChild(“HumanoidRootPart”)
if HumanoidRootPart then
HumanoidRootPart.CFrame = Part.CFrame
end
end
end
end

TeleportPlayers( --[[Insert part in Workspace that the players could Teleport to]])

7 Likes

It says "The current identity (2) cannot create a Player (lacking permission 4)

Its because where it says

TeleportPlayers( --[[Insert part in Workspace that the players could Teleport to]])

you are supposed to insert a part in the workspace everyone should teleport to

Edit: Make sure the part is anchored, Transparent and that it doesn’t collide

If you trying to do it from a local script would be good to use a Remote Event, because you can’t change a character’s position in the client.

This is completely false, the client has complete control over where their character goes.

4 Likes

Of course the client has control of where their character goes, just not the whole server.

1 Like