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

Humanoid:ChangeState() not working, need some help please?

I attempted to make the player who steps on the script's Parent (a Part in workspace) go into the HumanoidStateType.Ragdoll. Here's the script:

script.Parent.Touched:Connect(function(part)
	local parent = part.Parent 
	local human = parent:FindFirstChild("Humanoid") 
	if human then 
		human:ChangeState(Enum.HumanoidStateType.Ragdoll)
	end
end)

The script doesn't work, even when using a repeat wait()... until method

9 comments

0

Due to the default behavior of the Humanoid some states will automatically be changed when set to.

0

oh ok.

0

Why do you want the Humanoid to go into that state anyways?

0

im trying to make a slide

0

how would I make a player ragdoll. I can't find any tutorials on yt or anything in studio to use.

0
human.Sit = true
0
Humanoid.Sit = true
0
Humanoid.Sit = true
0
Humanoid.Sit = true

2 answers

Solution

You can only change states with a local script. If you want to force a state, you'll need to keep changing it.

game:GetService('RunService').RenderStepped:Connect(function()
	Humanoid:ChangeState('Swimming')
end)

Ragdoll Resources

I've recently used Tom_atoes Ragdoll script, it works great especially if you know how it works: https://devforum.roblox.com/t/tom-atoes-customisable-ragdoll/259927

This property released a while back. Many developers in the comments posted their code for it, you can use it: https://devforum.roblox.com/t/humanoid-breakjointsondeath/252053

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