So I'm trying to make a set of teleports that work based on clicking a brick as opposed to touching one. So far with the help of a friend I've got it to work, but it actually teleports all the players in the game, as opposed to just the one player that clicked it. We've both tried varying ways so that it only teleports the one player, but then the teleport doesn't work at all.
function onClicked()
local c = game.Players:GetChildren()
for i = 1, #c do
c[i].Character.Torso.CFrame = CFrame.new(script.Parent.Parent.DoorExit1.Position)
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
For the record, "DoorExit1" is the name of the brick that everyone gets teleported to. I am aware "GetChildren" is the phrasing for getting all the players, but I am honestly struggling to make it work through other methods. Please help!

2 comments
I tried something similar to that and it hadn't worked. But that does work. Thank you, it's a great help!
No problem.