How can i keep a ragdoll character after the players death

Im making a game that has an inspect body button after a player has died, but the player has a r6 ragdoll death and I want to keep the players ragdoll in the same place where they died but I dont know how I would do that. I tried just cloning the character model when he died, cloning every child of the model but it just doesnt work

the ragdoll script just incase:

local humanoid = script.Parent:WaitForChild("Humanoid")
local Torso: BasePart = script.Parent:FindFirstChild("Torso")
local Children = script.Parent:GetChildren()

humanoid.BreakJointsOnDeath = false

humanoid.Died:Connect(function()
	Torso:ApplyImpulse(Torso.CFrame.LookVector * -50)
	for index,joint in pairs(script.Parent:GetDescendants()) do
		if joint:IsA("Motor6D") then
			local socket = Instance.new("BallSocketConstraint")
			local a1 = Instance.new("Attachment")
			local a2 = Instance.new("Attachment")
			a1.Parent = joint.Part0
			a2.Parent = joint.Part1
			socket.Parent = joint.Parent
			socket.Attachment0 = a1
			socket.Attachment1 = a2
			a1.CFrame = joint.C0
			a2.CFrame = joint.C1
			socket.LimitsEnabled = true
			socket.TwistLimitsEnabled = true
			joint:Destroy()
		end
	end
end)
1 Like

You just clone the character itself and when the player respawns, put the character into a folder in the workspace.