Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How To Teleport All The Players When Clicking A Part?

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

1 answer

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)

2 comments

0

that didnt seem to work for me did i need to change anything?

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.