I've found a teleportation script and I'm having trouble on editing it. I'm not too familiar with scripting but I can read it, but this one has been a problem for me.
This script is supposed to teleport you on click (with click detector), not anyone else. It works fine, but not how I want it to.
I want this script to teleport yourself when you click it, this script teleports everyone to that part when someone clicks it, any help? Thanks!
Script and more details below...
Script for the first part (named Teleport1)
function onClicked()
local c = game.Players:GetChildren()
for i = 1, #c do
c[i].Character.Torso.CFrame = CFrame.new(script.Parent.Parent.Teleport2.Position)
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Script for the second part (named Teleport2)
function onClicked()
local c = game.Players:GetChildren()
for i = 1, #c do
c[i].Character.Torso.CFrame = CFrame.new(script.Parent.Parent.Teleport1.Position)
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
