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:
1 | script.Parent.Touched:Connect( function (part) |
2 | local parent = part.Parent |
3 | local human = parent:FindFirstChild( "Humanoid" ) |
4 | if human then |
5 | human:ChangeState(Enum.HumanoidStateType.Ragdoll) |
6 | end |
7 | end ) |
The script doesn't work, even when using a repeat wait()... until method
You can only change states with a local script
. If you want to force a state, you'll need to keep changing it.
1 | game:GetService( 'RunService' ).RenderStepped:Connect( function () |
2 | Humanoid:ChangeState( 'Swimming' ) |
3 | end ) |
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