Temporary Ragdoll?

Yes… Exactly. But you get back up afterwords

try this i think this has been done before but this is a code i found on researching the forum
local died
died = character.Humanoid.Died:Connect(function()
local d = character:GetDescendants()
for i=1,#d do
local desc = d[i]
if desc:IsA(“Motor6D”) then
local socket = Instance.new(“BallSocketConstraint”)
local part0 = desc.Part0
local joint_name = desc.Name
local attachment0 = desc.Parent:FindFirstChild(joint_name…“Attachment”) or desc.Parent:FindFirstChild(joint_name…“RigAttachment”)
local attachment1 = part0:FindFirstChild(joint_name…“Attachment”) or part0:FindFirstChild(joint_name…“RigAttachment”)
if attachment0 and attachment1 then
socket.Attachment0, socket.Attachment1 = attachment0, attachment1
socket.Parent = desc.Parent
desc:Destroy()
end
end
end
end)

*This is what @Fm_Trick did and he’s top contributor so it should work

3 Likes

I have decided to update this reply so it’s clearer.

First of all you need to disable the RequiresNeck property from the Humanoid you want to ragdoll momentarily, this is an important step because otherwise it would die. (Note: This doesn’t have to be done everytime, just do it once and it’ll be fine!)

To accomplish this temporary ragdoll you would set the Humanoid’s state to something like Enum.HumanoidStateType.Physics and afterwards you would loop through all of the Character’s Motor6Ds and disable them, do this for the Constraints too but instead of disabling you would enable them.

Finally after a set amount of time, you would change the Humanoid’s state to something like Enum.HumanoidStateType.Ragdoll or any other state you want, then you would enable the Motor6Ds back and disable the Constraints.

Hopefully this is more understandable than before, good luck!

23 Likes

There a lot of ragdoll scripts/modules out there. Check this out

You did not press the code button.
It’s on the topbar when you write something.

1 Like

This one is pretty epic; you can even preview it in an uncopylocked game

4 Likes

I personally made one of these, however at the moment I don’t have access to my PC, it was also made using OOP.

RAGDOLL.lua (4.5 KB)

Whenever I use this @r0bl0xic808, the humanoid goes launching endlessly in the air. Anyone know how to fix this?

didn’t work lol. character just automatically dies whenever their motor6d’s are changed in any way.

When I did this, the constraints were enabled and then I’d switch every Motor6Ds Part0 to nil (In that order, so the character does not die) though a better way to do this would be to disable the Motor6Ds instead, unchecking the Enabled property.

Another thing you can do is to uncheck the Humanoid’s RequiresNeck property, so it won’t die if the Neck is somehow unattached since that seems to be your problem, my reply was written before RequiresNeck was added as a property.

4 Likes

You’re a life saver. I’ll try to answer back when I test it out myself.

Yep. Works like a charm. Much obliged. You da man :moyai:

Hey, would you mind explaining what you did differently that now made it work? I’m trying to do what @dcampeon said, but I’m having the same problem that you are, and I don’t know what he means when he says:

More specifically, “in that order, so the character does not die.” That seems like the key change you made but I have no idea what he means by “in that order.” Do what? And in what order? Thanks in advanced if you can help me!

I have updated my initial reply, check it out!

Thank you for your reply! So,

Are you talking about the BallSocketConstraint(s) that I would have to create? If so, I am assuming that you would create the BallSocketConstraints when a character is added and default them to disabled, and then enable them when you want to ragdoll, as well as disable the Motor6D’s. What I’m doing is creating the BallSocketConstraints when a certain event happens, which makes them automatically enabled. Is there any difference between the two methods? This should mean that how I’m doing it should work, as long as I am disabling the Motor6D’s at the same time, correct?

Yes and yes, and there shouldn’t be any difference though I would create them once and keep them disabled until needed.

1 Like

Uhhh…Almost there? Take a look

https://gyazo.com/649abb093443d99db6e08fd496c952dc

Code:
https://hastebin.com/ewapozoloq.lua

Change the State from FallingDown to Physics so it doesn’t automatically get set back to another one.

Edit: Don’t disable the HumanoidRootPart’s Motor6D or add constraints to it, leave that untouched otherwise it will throw weird results.

Made those changes, now the character stands upright and can still jump and walk around. I want to make it so that they fall on the floor and are unable to move until the duration is up. Also, the limbs or anywhere I place the ball sockets make limbs flail around a lot, more than I would prefer. Any idea how to fix these problems?

Never mind, I figured out why this happened. Altering the HumanoidRootPart by disabling its motor and adding a constraint are perfectly fine. What I did was fire a remote on the client side that a local script in the StarterPlayerScripts would pick up and change the humanoid state. Fixed everything. :ok_hand:

1 Like