Hey there, new scripter here
I was wondering how i would go about Force Teleporting players to a certain Part?
Thanks!,
Hey there, new scripter here
I was wondering how i would go about Force Teleporting players to a certain Part?
Thanks!,
local part = workspace.Part -- Change this
for i,v in next, game.Players:GetPlayers() do -- loop through the players
local chr = v.Character
if chr and chr:FindFirstChild("HumanoidRootPart") then -- check if they have a character and humanoidrootpart
chr:SetPrimaryPartCFrame(part.CFrame) -- set their cframe to the part's cframe.
end
end
Thanks!
ummm you can change the next to pairs
yes you can.
local PartToTeleportTo = game.Workspace:FindFirstChild("") --// Fill this in with the part name.
for i,v in pairs(game.Players:GetPlayers()) do
v.Character.HumanoidRootPart.CFrame = PartToTeleportTo.CFrame
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Set the player’s cframe to the part’s cframe