function Click(tp)
if tp.Character then
if tp.Character:FindFirstChild("Torso") then
tp.Character.Torso.CFrame = CFrame.new(script.Parent.TeleportPosition.Value + Vector3.new(0,2.4,0))
end
end
end
script.Parent.ClickDetector.MouseClick:connect(Click)
To teleport people to different positions but, it only works in R6 and not R15, how can I make it work with R15?
function Click(tp)
if tp.Character then
if tp.Character:FindFirstChild("HumanoidRootPart")
tp.Character.HumanoidRootPart.CFrame.CFrame = CFrame.new(script.Parent.TeleportPosition.Value + Vector3.new(0,2.4,0))
end
end
end
script.Parent.ClickDetector.MouseClick:connect(Click)
This is the script I fixed the things you mentioned too:
function Click(tp)
if tp.Character then
if tp.Character:FindFirstChild("HumanoidRootPart")
tp.Character.HumanoidRootPart.CFrame = CFrame.new(script.Parent.TeleportPosition.Value + Vector3.new(0,2.4,0))
end
end
end
script.Parent.ClickDetector.MouseClick:Connect()
You’ve also removed the then from the if statement.
Copy and paste EXACTLY the following script:
function Click(tp)
if tp.Character then
if tp.Character:FindFirstChild("HumanoidRootPart") then
tp.Character.HumanoidRootPart.CFrame = CFrame.new(script.Parent.TeleportPosition.Value + Vector3.new(0,2.4,0))
end
end
end
script.Parent.ClickDetector.MouseClick:Connect(Click)