Doesn’t Seem like it worked, same thing, No Errors in output. Do you think I should make the Parent of the script StarterCharacterScripts or keep it as ServerScriptService?
yes,
no,
yes,
when I made it so it would print if the player died and ragdolled nothing came in the output.
local humanoid = script.Parent:WaitForChild('Humanoid')
humanoid.BreakJointsOnDeath = false
humanoid.Died:Connect(function()
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()
print("Player Has Died and Ragdoll Was Succsesful!")
end
end
end)
In the script you showed me then it would look like this,
script.Parent:WaitForChild("Humanoid").BreakJointsOnDeath = false
script.Parent.Humanoid.Died:Connect(function()
for _, v in pairs(script.Parent:GetDescendants()) do
if v:IsA("Motor6D") then
local Att0, Att1 = Instance.new("Attachment"), Instance.new("Attachment")
Att0.CFrame = v.C0
Att1.CFrame = v.C1
Att0.Parent = v.Part0
Att1.Parent = v.Part1
local BSC = Instance.new("BallSocketConstraint")
BSC.Attachment0 = Att0
BSC.Attachment1 = Att1
BSC.Parent = v.Part0
v:Destroy()
print("Player Has Died and Ragdoll Was Succsesful!")
end
end
script.Parent.HumanoidRootPart.CanCollide = false
end)
I also tried to fire this but nothing comes in the output and it doesnt work.
Since the game despawns the character model when the player respawns, I simply make the ragdoll script move everything inside the character into another model. The game will despawn the character model (which is now empty), and the new model will persist. You might have to fix the camera in certain cases but this is my go to method for making them persist.
From experience, as long as you also transfer the Humanoid over, the clothing should render as well. If you only transfer the baseparts and the shirt, the game wont think it’s a valid person to apply clothing to, so you need to also move the humanoid over.
Yea but when I do that, the body floats up for some reason (when i mentioned having to change up stuff, i had to clone a new humanoid to remove the float, but clothing would not work), recently found a half fix, but after player respawns, the body returns to a stand up stance ( all stiff, without animation) when you step close to the ragdoll’d body
heres a link to the post (I will also post on the link as well, with video and my code:
Ultimately If I can’t figure out how to remove the glitches that go along side making the ragdoll persist, im just settle with letting it despawn on character respawn.