Emilio's ragdoll module (Easy ahh ragdolls R15 and R6)

Yeah bro, either is fine with me.


For everyone wondering:
Im trying to fix camera shake on R15 rigs so thats being worked on currently!


Update2:
Its fixed and update is out

sumthin a lil funky is goin on with mine (anyone got a fix?)

Hello,
are you running the newest version of the module?
If so, could you show me the code for the part?

yeah im just using the npcragdoll function when the part is touched and hit.parent:findfirstchildofclass(ā€œhumanoidā€) then npcragdoll(hit.parent, 20) idk why its so weird

Yeah, so show like whole script? And want to take it into dms?

yeah sure thx im not on pc rn but ill dm when i can

It should be fixed (In theory) and make sure to add a debounce on the :RagdollNpc()
or else it will have spasms

alright yeah you know what iā€™m 99% sure it was cause i didnā€™t do any debounce but just a quick suggestion you donā€™t have to add it but maybe in the npcragdoll function in the module you could do a quick check to see if the npc is already ragdolled? idk just a thought in case other people didnā€™t know about this; also, just another suggestion is that if the time for the ragdoll is nonexistent then maybe it could be a permanent ragdoll. Again these are just suggestions in my opinion i think they could possibly make the module better :grin: iā€™ll be doing it on my own tho so if you donā€™t like these suggestions its all good

edit: if i were to do this hereā€™s how itā€™d look:

function module.NpcRagdoll(char : Model, sec : number) -- npcc
	local humanoid : Humanoid = char:WaitForChild("Humanoid")
	humanoid.BreakJointsOnDeath = false
	
	if humanoid:GetState() ~= Enum.HumanoidStateType.Physics then
		for index, joint in pairs(char:GetDescendants()) do
			if joint:IsA("Motor6D") then
				local socket = Instance.new("BallSocketConstraint")
				local a1 = Instance.new("Attachment")
				local a2 = Instance.new("Attachment")
				a1.Parent = joint.Part0
				a2.Parent = joint.Part1
				socket.Parent = joint.Parent
				socket.Attachment0 = a1
				socket.Attachment1 = a2
				a1.CFrame = joint.C0
				a2.CFrame = joint.C1
				socket.LimitsEnabled = true
				socket.TwistLimitsEnabled = true
				humanoid.PlatformStand = true
				if joint.Name == "Neck" then
					socket:Destroy()
					local hinge = Instance.new("HingeConstraint")
					hinge.Parent = joint.Parent
					hinge.Attachment0 = a1
					hinge.Attachment1 = a2
					hinge.LimitsEnabled = true
				end
				humanoid:ChangeState(Enum.HumanoidStateType.Physics)
				joint.Enabled = false
			end
		end
		if sec then
			task.wait(sec)
			
			for index, joint in pairs(char:GetDescendants()) do
				if joint:IsA("Motor6D") then
					local socket = joint.Parent:FindFirstChild("BallSocketConstraint") or joint.Parent:FindFirstChild("HingeConstraint")
					local a1 = joint.Part0:FindFirstChild("Attachment")
					local a2 = joint.Part1:FindFirstChild("Attachment")
					socket.LimitsEnabled = true
					if socket:IsA("BallSocketConstraint")  then
						socket.TwistLimitsEnabled = true
					end
					socket:Destroy()
					a1:Destroy()
					a2:Destroy()
					humanoid.PlatformStand = false
					humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
					joint.Enabled = true
				end
			end
		end
	end
end

obviously these are all just personal preference but overall this module is great and completely saved my game! thanks dude this module genuinely is probably the best R6 ragdoll module out there!

No bro, I think your suggestions are really neat. I will add them for sure. Thanks for using my module

1 Like

hey thanks dude no problem just a quick question do you have any idea why this might happen?


see how the npcā€™s like freeze for a sec right before they hit the part? and in run mode it looks perfectly fine and smooth? is there any way to fix this?

might be something with networks ownership or mass, I will experiment with it later when Iā€™m on my pc

1 Like

There might be no way to get rid of the sloppynes so we just have to live life with it :frowning: . But i will see which suggestions i will addā€¦

1 Like

i thought about it and what if it has to do with the pathfinding? maybe if the pathfinding ran on the client that would fix it? cause it seems smooth when you ragdoll the npc while theyre not moving idk just a thought ngl your probably right tho it doesnt seem like theres a good fix for it

1 Like

ill try it out when i can and post how it goes if its good prob

btw at line 128-129

if not plr:IsA("Player") then error("You wanted to ragdoll a non plr using the: TimedRagdoll() ?") end
remote:FireClient(plr, "Destroy", sec)

if the plr somehow doesnā€™t exist when this code fires youā€™ll get an error back(for example a player dies and it doesnā€™t get instantiated again, happened to me), a better way would be to check for the plr and I personally would remove the error catch because at that point itā€™s scripters fault for not reading better and it looks messy checking twice for plr on both the error and before firing the remote (if you donā€™t do checks at both lines the error can happen on either one)

local plr = game.Players:GetPlayerFromCharacter(char)
if plr then remote:FireClient(plr, "Destroy", sec) end
1 Like

alright, after being on my computer basically all day melting my life away, iā€™ve found out a few things

  • for smooth ragdolls and npc pathfinding just set the networkownership to a player

yeah thatā€™s basically it haha (what am i doing with my life) anyways, the problem with this is that it introduces a ton of new problems

  • check for if ragdoll is a ragdoll does not work, because the server thinks that the humanoidstatetype is seemingly random things when in physics state (most notably being platformstanding and running for some reason)

  • limbs clipping through the ground (i canā€™t find the fix like anywhere :cry:)

  • and finally, most disapointingly, is that the ragdoll is only spectacularly smooth for the person who owns it, and if you care about exploiters then that sucks as well :skull::skull::skull:

yeah if anyone wants to try to figure out fixes to these problems with me i think it would make the module mucha better and it would be greatly appreciated

thanks for reading my yapping all the way to here

If there is no other way to make it smoother than it is then i wont even bother find a way. But a new update has dropped fixing a issue with R15 that i found and including what @tibiscus said.

1 Like

the ragdoll moduleā€¦ Is gone!!!

2 Likes

Cheese himself isā€¦ GONE!!! :broken_heart::frowning:

Did roblox bring nothing after rthro? Thatā€™s sad.