Error: Torso not A Valid Member of model

I am trying to make a hamster ball and this line keeps coming up with a “Torso is not a valid member of model” error.

 game.Players:FindFirstChild(hit.Parent.Name).Character.Torso.CFrame = script.Parent.CFrame + Vector3.new(0,.5,0)

What can i do to fix this?

1 Like

Use :WaitForChild(“Torso”) instead, the torso may have no loaded in yet.

2 Likes

Are you using r6 or r15? If you are using r15, there is an upper and lower torso.

3 Likes

Yup, that fixed it. All i need now is to add controls.

Please mark it as a solution in case people in the future with the same problem stumbles upon this thread.

KK it looks better now also.

Oh another thing how do i make it stay on when i respawn and just be on me the whole time (It shouldn’t be able to come off the player):

-- Script --
colors = {"Bright blue","Bright red","Bright green","Bright yellow","Bright orange"}
script.Parent.BrickColor = BrickColor.new(colors[math.random(1,#colors)])

function touch(hit)
	local h = hit.Parent:FindFirstChild("Humanoid")
	if h then
		local stuff = hit.Parent:GetChildren()
		for i = 1,#stuff do
			if stuff[i].ClassName == "Hat" then
				stuff[i]:Destroy()
			end
		end
		
		game.Players:FindFirstChild(hit.Parent.Name).Character.Torso.CFrame = script.Parent.CFrame + Vector3.new(0,.5,0)
		script.Parent.Parent = hit.Parent
		local w = Instance.new("Weld")
		w.Part0 = hit.Parent.Torso
		w.Part1 = script.Parent
		w.Parent = hit.Parent.Torso
		
		while true do
			wait()
			h.Sit = true
		end
		
	end
end

script.Parent.Touched:connect(touch)

I’d suggest you create a new thread for this.

Okay, I will. Thanks for your help tho