How to have corpses, and ragdolls

How do I make dead bodies stay for like 1 minute or so?? I have a ragdoll script, but would like corpses also to add to the warzone feeling. Thx for the help, and also couldn’t find any other topics on this, if it has already been answered send me a link.

2 Likes

What do you need help with exactly? Making the corpses disappear after a certain amount of time or make them ragdoll?

3 Likes

He wanted to know how to make a ragdoll system, that when you either press a button ragdoll and undo and also that the corpse disappear after a certain amount of time.

1 Like

All you would do is clone the player after they die, create a ragdoll script, then a minute later destroy it with either :Destroy() or I saw some scripts using Debris. Also make sure that BreakJointsOnDeath is toggled off. I believe it’s either a property of StarterPlayer or Players I forgot.

2 Likes

I’d recommend using Debris.
Here is an article that explains how to use it and why it is recommended to use over :Destroy()

4 Likes

No, actually what rokoblox5 said.

Oh, my apologies. I thought he didn’t understood what you posted.

I recommend checking out this article: Humanoid.BreakJointsOnDeath - #13 by Fm_Trick

To create what you want I would do something like this:

-- Settings: --
local DecayTime = 60 -- seconds
local ResetsOnDeath = true -- This determines whether or not the old corpse is destroyed if the player dies and the other corpse hasn't disappeared yet.
---------------

local Debris = game:GetService("Debris")
local Players = game:GetService("Players")
local Corpses = {}

Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        local humanoid = character:FindFirstChildOfClass("Humanoid")
        humanoid.BreakJointsOnDeath = false

        humanoid.Died:Connect(function()
            character.Archivable = true -- Makes the players body able to be cloned
        
            if ResetsOnDeath and Corpses[player] then
                Corpses[player]:Destroy()
                Corpses[player] = character:Clone()
            end
        
            local corpse = Corpses[player]
            for _,desc in ipairs(corpse:GetChildren()) do
                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

            corpse.Parent = workspace
            Debris:AddItem(corpse,DecayTime)
        end
    end)
end)

NOTE: This code is untested so you may have to edit a few things as they pop up.

3 Likes

it doesn’t seems to work, unfortunatly
(Just want to precise that a ) is missing at line 41)

1 Like