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

Why doesn't this script work? Torso is not a valid member of Model?

Hello. I tried to make a part that gives you an antigravity effect when you touch it; but it prints out an error: "Torso is not a valid member of model".

enabled = true

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild('Humanoid') and enabled then
		enabled = false
		local bodyForce = Instance.new("BodyForce", hit.Parent.Torso)
		bodyForce.Force = Vector3.new(0,1000,0)
	end
end)

2 answers

✓ Accepted answer

You want to be using HumanoidRootPart instead of Torso as this is common to all body types.

Hey, may you tell me the type of character your game is? R6 or R15?

2 comments

0

If it is R6, then there's a problem, but if it is R15 then you must put: "UpperTorso" instead of "Torso"

0

my game is in R6? Is there a way to fix it?

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