Title pretty much explains it, ragdoll only starts occasionally, usually when I die midair, it almost never starts right away when I die on the ground.
The script:
local Humanoid = script.Parent:WaitForChild("Humanoid")
local HRP = script.Parent:WaitForChild("HumanoidRootPart")
Humanoid.BreakJointsOnDeath = false
Humanoid.RequiresNeck = false
script.Parent.Humanoid.Died:Connect(function()
HRP.CanCollide = true
HRP:SetNetworkOwner(nil)
Humanoid.AutoRotate = false
Humanoid.PlatformStand = true
for i, v in pairs(script.Parent:GetDescendants()) do
if v:IsA("Motor6D") then
local socket = Instance.new("BallSocketConstraint")
socket.LimitsEnabled = true
socket.TwistLimitsEnabled = true
local a0 = Instance.new("Attachment")
local a1 = Instance.new("Attachment")
a0.CFrame = v.C0
a0.Parent = v.Part0
a1.CFrame = v.C1
a1.Parent = v.Part1
socket.Parent = v.Parent
socket.Attachment0 = a0
socket.Attachment1 = a1
v:Destroy()
end
end
end)
I found out that the problem is when the ragdoll doesn’t start it’s because the ball socket just isn’t being added until the body stops moving, but I still don’t know how to solve it
ok so has it turns out the ragdoll is only delayed if the death is caused by the client (like resetting)
I have literally no idea why that is but it works fine if I am killed by a server script. Luckily I plan on having resetting off in this game so I don’t have to worry about client deaths.
Sorry for the inconvenience, and thanks for trying to help
(Also your script had a better looking ragdoll so I’ll still mark it as solution)