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.
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.
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
-- To ragdoll/unragdoll you can either do
-- or you can
npc.RagdollTrigger.Value = true -- Ragdoll
npc.RagdollTrigger.Value = false -- Unragdoll
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.
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.