I need help making a part if you touch it tps you to where you put it

script.Parent.Touched:Connect(function(hit)

local plr = game.Players:GetPlayerFromCharacter(hit.Parent)



if hit.Parent:FindFirstChild("Humanoid") then
	plr.Position = (CFrame(0, 0, 0))
end

end)

What is the issue with the script? From what I gather, you are trying to make the part teleport the player but you haven’t specified where to teleport the player to (apart from CFrame 0,0,0).

player tp’s to the point 0,0,0

or should i change it to where you tp to a part

Alright well try this:

script.Parent.Touched:Connect(function(hitPart)
	local char = hitPart.Parent
	local root = char:FindFirstChild("HumanoidRootPart")
	
	root.Position = Vector3.new(0,0,0)
end)

This will teleport the player to the position 0,0,0 on the map. You may configure it to suit your game.

The hierarchy should be like this.
image

thank you so much it works and yes that is ther hierchy

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.