Corpse system needs help

Im making a game where i would like to have the body or avatar remain where they died, it already has a ragdoll script but ive been struggling for a long time to find a solution for this,

Anyone who could share a ready script or link to any video or a tutorial somewhere?

the player who dies will be kicked immideately , but their body should remain maybe dublicate and remain there. ive had problems dublicating as in making their body remain

You disable joint on death inside humanoid

Can i do this in properties somewhere? or script required and where exactly

Its a property but can be used in a script too

so where do i disable it? i cant find the option in starterplayerscripts

Its called “BreakJointsOnDeath”

there is no such option in properties in Starterplayer or any of playerscripts and characterscripts

When the character spawns, set the humanoid’s property BreakJointsOnDeath to false. This will break the character from breaking apart on death, allowing you to have a custom ragdoll system. Or, if you just enable the AvatarJointUpdate in StarterPlayer, a ragdoll is automatically applied instead of breaking joints.

Its inside the humanoid. Simple

I did it while playtesting, but when i playtest again or stop it then it resets and it turned on automatically

Check if the player dies and then just clone the dead character ( make sure “archivable” property is set to true) and then place the clone in the workspace.

When you die and respawn, a new character is created. That also means a new Humanoid with default properties. You need to change the Humanoid.BreakJointsOnDeath property every time they respawn. You can detect this with the player.CharacterAdded event.

thats what im asking to get help with i havent seen a tutorial anywhere either and as i said im a little confused where i check the “archivable” where is it?

If you have the humanoid, you can use the .Died function.

Humanoid.Died:Connect(function()
 Humanoid.Parent.Archivable = true
 Humanoid.Parent:Clone().Parent = workspace
end)

I believe something like that works.

local or serverscript and where should i place this ?

apologies for late post. this is a serversided script and this is how i did it

Humanoid.Died:Connect(function()
  local corpse = Instance.new("Model")
  corpse.Parent = workspace.Terrain -- don't consider doing this it's just a placeholder
  corpse.Name = player.Name.."'s Corpse"
  for _, limb in character:GetChildren() do
     if limb:IsA("LuaSourceContainer") then continue end -- if the thing is a script, skip it
     limb.Parent = corpse
  end
end)

not the best approach, q_Emilio’s approach may be better for performance.

After your script detects that a player has died, I recommend waiting for the ragdoll to settle, after that you can then kick the player. This is assuming that your ragdoll system does not clone the character to create a separate ragdoll model.

I highly recommend to modify your ragdoll system to clone the character so even if the player is gone, their duplicate/clone still remains as it is not tied to the PlayerRemoving.

Optional: Make sure their corpse is not moving by checking the AssemblyLinearVelocity property on the HumanoidRootPart, after that we will anchor every part on the character. This is not necessary but this is just some optimizations for your game so the ragdoll’s constraints does not need to keep calculating anymore. This also allows you to have more corpse in the game.

Hope this helps!