I followed a tutorial online on how to script a ragdoll death, but it doesn’t seem to work. I can’t find any other solutions online. There aren’t any errors that pop up on the output, and there aren’t any past solutions on the forum. Can someone take a quick look? This is on the client in PlayerCharacterScripts.
-- [[ Services ]] --
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local playerHumanoid = character:WaitForChild("Humanoid")
playerHumanoid.Died:Connect(function()
playerHumanoid.BreakJointsOnDeath = false
for _, v in pairs(character:GetDescendants()) do
if v:IsA("Motor6D") then
local attachment0,attachment1 = Instance.new("Attachment"), Instance.new("Attachment")
attachment0.CFrame = v.C0
attachment1.CFrame = v.C1
attachment0.Parent = v.Part0
attachment1.Parent = v.Part1
local ballConstraint = Instance.new("BallSocketConstraint")
ballConstraint.Attatchment0 = attachment0
ballConstraint.Attatchment1 = attachment1
ballConstraint.Parent = v.Part0
v:Destroy()
end
end
character.HumanoidRootPart.CanCollide = false
end)
end)
end)