I don't understand how to make this group only:

function onClicked()
    local p = game.Players:GetChildren()
    for i = 1, #p do
        p[i].Character:MoveTo(Vector3.new(-117, 0.5, 13))
    end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

4 comments

0

Please use code block

0

yo this actucally might help me thank you :D

0

This code is going to teleport every last Player in the game from one Player's click?? Where is the indentation my guy.

0

You can use :IsInGroup(). MouseClicked passes the Player that clicked as an argument to the callback, I suggest you accept that as a parameter for ease.