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 4 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 4 years ago

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

01local players = game:GetService("Players")
02local ClickDetector = script.Parent
03 
04ClickDetector.MouseClick:Connect(function()
05    for i,v in pairs(workspace:GetChildren()) do
06        if players:GetPlayerFromCharacter(v) then
07            local hr = v:FindFirstChild("HumanoidRootPart")
08            hr.CFrame = CFrame.new(79.8, 0.5, -63.6)
09        end
10    end
11end)
0
that didnt seem to work for me did i need to change anything? jumpy_legs 12 — 4y
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 — 4y
Ad

Answer this question