Smooth R6 Ragdoll for Players and NPCs (Plug-and-Play)

image
Any ideas

If you are setting up ragdoll on an NPC, make sure it has no anchored parts

local r6Module = require(game.ServerScriptService.R6Ragdoll.ModuleScript)

game.ReplicatedStorage.OneSecondRagdoll.OnServerEvent:Connect(function(player, npc, number)
	r6Module:Setup(npc)
	r6Module:Ragdoll(npc)
	wait(number)
	r6Module:Unragdoll(npc)
end)

Also no it doesn’t have a single anchored part

This is a server script btw. And its firing good and also the npc value should be correct. Ill double check. Yeah its printing the correct model. The model is a npc, nothing anchored

Works for me, just check for anchored parts, mainly HumanoidRootPart

Yeah no its not anchored. Also I just want this to work for a npc.
image
also hes walking proving he isnt anchored

you can anchor a humanoidrootpart and it will still walk i thought?

1 Like

Hey, so i wish to make a ragdoll weapon which ragdolls another player when they are hit, i have been trying to make this work but i haven’t gotten it to work, help is much appreciated, Thanks!

1 Like

set the player’s ragdolltrigger value to true and they will ragdoll (will only work on server-side scripts)

2 Likes

When I ragdoll npcs they get flung around all over the place. How do I fix this.

1 Like

Your ragdoll system makes the character freeze after death sometimes. How I know this is I removed your ragdoll script, tested it out, and I added your ragdoll script, tested out, and there’s the difference:

2 Likes

how would i create a script that checks when you die and triggers the ragdoll?

1 Like

Can you make this work with r15?

1 Like

There already is a good R15 ragdoll module, if you look for it i am sure you will find it.

1 Like

To fix your character so they don’t freeze after death using this Ragdoll system,

just enable these:

		humanoid.BreakJointsOnDeath = true
		humanoid.RequiresNeck = true
1 Like
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
         character:WaitForChild("Humanoid").Died:Connect(function()
             task.wait()
             character.RagdollTrigger = true
         end
    end
end

I have a problem. The NPCs seem to have a hard time getting up after ragdolling.

This is the code which I use to handle ragdolls:

function module:Ragdoll(target, knockTime)
	if not target:FindFirstChild("RagdollConstraints") then
		ragdoll:Setup(target)
	end
	
	ragdoll:Ragdoll(target)

	task.delay(knockTime, function()
		ragdoll:Unragdoll(target)
	end)
end

I also apply a force when the target is ragdolled, for extra impact, but I don’t know if that’s what’s causing it (in this case physical is true)

function module:Knockback(sender, reciever, power, physical)
	local vec = sender.PrimaryPart.CFrame.LookVector * power
	local prim = reciever.PrimaryPart
	
	if physical then
		prim:ApplyImpulse(vec)
	else
		ts:Create(prim, TweenInfo.new(0.5, Enum.EasingStyle.Linear), {Position = prim.CFrame * vec}):Play()
	end
end

im having a problem where ragdolled players would float

4 Likes

So i figured out a way, since its the opposite player im supposed to ragdoll, i first detect the touch of the other player, then locate RagdollTrigger in their Character and then Enable its value to true