So I found a script for when I click the brick it teleports me to the other brick. When my friend joined and i clicked it and he was still spawning in it teleported him with me. Can someone tell me how to make it so only the person who click the brick gets teleported please.
This is the script im using:
function onClicked()
local c = game.Players:GetChildren() for i = 1, #c do c[i].Character.Torso.CFrame = CFrame.new(script.Parent.Parent.block2.Position)--change "block2" to the name of the object you want to be teled to... end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

5 comments
I can't tell you whats wrong with the script, but I can tell you an easier way of doing it: Use moveTo()
Its because you didn't specify a certain player. I made you a script in your last post that only teleports the clicker.
Use a code block or ~85% of us won't bother reading it(me included)
Sorry im new to all of this @lukeb50
@project Can you do it again please