Take the R6Ragdoll server script and put it in ServerScriptService, it will automatically deploy itself.
(If you know what you are doing, you can always just copy the code and put it where you want)
Now if you want to trigger the ragdoll on any player, in a server script set the value of RagdollTrigger which is parented to the player’s character to true, and if you want to unragdoll, just set it back to false.
How to setup for NPCs:
NOTE: Setting ragdoll for NPCs sets their network ownership to the server. This is done to make sure the NPC doesn’t exist ragdoll when a player gets near them.
Manually:
Inside the R6Ragdoll script, you will find another script called R6NPCRagdoll, copy and paste it inside your R6 NPC and set the Enabled property of the coppied script to true.
Using code:
Now just require the module and call :Setup() and pass your NPC model as the argument:
-- Require the module
local r6Module = require(game.ServerScriptService.R6Ragdoll.ModuleScript)
-- Setup the ragdoll for your npc
local npc = workspace.NPC
r6Module:Setup(npc)
-- To ragdoll/unragdoll you can either do
r6Module:Ragdoll(npc)
r6Module:Unragdoll(npc)
-- or you can
npc.RagdollTrigger.Value = true -- Ragdoll
npc.RagdollTrigger.Value = false -- Unragdoll
Yes, as long as it’s R6 (6 joints) it will work, it will also interact with the welded items if you have their can-collide on, so you can expect it to be realistc.
I’m facing some difficulties while using this module to make a ragdoll NPC with the same capabilities as the Players. What I’m trying to say is, If I take the RagdollTrigger that’s inside the NPC’ and set it’s value to true, it should ragdoll. and vice versa, for unragdolling.
It is smooth only for the client ragdolling, you won’t have the torso going without the limbs only for client that has been ragdolled, which is why I showed the view of the other player sees it in the recording.
im using it in vent systems where you need to slide down, using a ragdoll to tumble you down just felt cool, compared to walking down the steep vent
the smooth transition is incredibly helpful in times where you want it to smoothly transition, such as the ground breaking from under you, or sliding down a very long tube/vent
I really like this and it works well. I was wondering how I can make it work on death. I turned off break joints on death. this is my script. the character just stands weird like in the picture. The value does enable I checked.