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

How To Teleport All The Players When Clicking A Part?

Asked by 3 years ago

Im Trying To Figure This Out And I Cant Seem To Find Any Solutions... Does Anyone Know How To Do This

1 answer

Log in to vote
0
Answered by 3 years ago

have a clickdetector in a part and put in the following:

local players = game:GetService("Players")
local ClickDetector = script.Parent

ClickDetector.MouseClick:Connect(function()
    for i,v in pairs(workspace:GetChildren()) do
        if players:GetPlayerFromCharacter(v) then
            local hr = v:FindFirstChild("HumanoidRootPart")
            hr.CFrame = CFrame.new(79.8, 0.5, -63.6) 
        end
    end
end)
0
that didnt seem to work for me did i need to change anything? jumpy_legs 12 — 3y
0
Where there any errors? If not, then tell me if you put all the players in workspace inside a folder or any other instance. AntoninFearless 622 — 3y
Ad

Answer this question