Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

It keeps saying "Torso is not a valid member of Model". How do I fix this?

I'm trying to make it so that a player is transported from one object to the other by stepping on it, but this error keeps showing up and I have no idea how to fix it.

script.Parent.Touched:connect(function(hit)
	if hit.Parent:FindFirstChild('Humanoid') then
		hit.Parent.Torso.CFrame = CFrame.new(439.763, 4.144, 128.675)

	
	end
end)

Any help please?

1 comment

0

Use the HumanoidRootPart for transporting a player.

1 answer

There are two types of default character rigs on Roblox. One is called R15 and the other is called R6 (as you might know already). Different rigs use different names for body parts. For example, the torso is called Torso in R6 rigs and UpperTorso for R15 rigs. In your case, this would simply mean that you would have to change hit.Parent.Torso to hit.Parent.UpperTorso. However, it's better to use HumanoidRootPart as it's consistent amongst all character rigs.

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		hit.HumanoidRootPart.CFrame = CFrame.new(439.763, 4.144, 128.675)
	end
end)

1 comment

0

Thanks for the tip!

This discussion is preserved as it was. New answers, comments, and votes are closed.