Teleport Button

Okay so I used this script:

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?

Change

tp.Character.Torso.CFrame

to

tp.Character.HumanoidRootPart.CFrame

EDIT:
You’ll also need to change tp.Character:FindFirstChild("Torso") to tp.Character:FindFirstChild("HumanoidRootPart")

ew. :connect() is deprecated, might want to change that.

1 Like

I changed it to this:

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)

But it still did not work :frowning:

That script is definitely a relic.

@000GeorgeSto You’ll want to use :Connect() instead of :connect()

You’ve repeated CFrame twice, it needs to be tp.Character.HumanoidRootPart.CFrame

It still didn’t work I got this error:
image

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)
1 Like

Thank you so much for your help I am sorry for my misunderstanding.