My script is in a part, and it is supposed to teleport the player that clicks the part to another part called Teleport. For some reason, it teleports every player in the server to Teleport. Can anyone help?
My script -
function onClicked()
local c = game.Players:GetChildren()
for i = 1, #c do
c[i].Character.Torso.CFrame = CFrame.new(script.Parent.Parent.Teleport.Position)
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
