CFrame TP Issue

Hello everyone,

So I am trying to make it so that when you touch a part it TP’s you to another area. I made this script but getting an error and I have not used CFrame lots in the past so I am unsure on how to fix this issue.

Script:

local telpart = script.Parent
telpart.Touched:Connect(function(plr)
	local player = plr.Parent
	if player:FindFirstChild("Humanoid") ~= nil then
		print("Player is true")
		local plrtp = player:FindFirstChild("Humanoid")
		plrtp.HumanoidRootPart.CFrame = workspace.TestTP.CFrame
	end
end)

Change to

plrtp.HumanoidRootPart.CFrame = CFrame.new(workspace.TestTP.Position)

Should work, lmk if anything else goes wrong

You are trying to look for the HumanoidRootPart in the Humanoid.
Instead do:

		player.HumanoidRootPart.CFrame = workspace.TestTP.CFrame
1 Like