I made this lil ragdoll script but sometimes the player will stay standing up after dying, i want to know how i could make it push the player backwards a little so they will fall over.
–The Script
game.Players.PlayerAdded:Connect(function (player)
player.CharacterAdded:Connect(function (char)
local hum = char:FindFirstChild("Humanoid")
local HumRoot = char:FindFirstChild("HumanoidRootPart")
hum.BreakJointsOnDeath = false
hum.Died:Connect(function ()
for _, descendant in pairs(char:GetDescendants()) do
if descendant:isA("Motor6D") then
local socket = Instance.new("BallSocketConstraint")
local a1 = Instance.new("Attachment")
local a2 = Instance.new("Attachment")
a1.Parent = descendant.Part0
a2.Parent = descendant.Part1
socket.Parent = descendant.Parent
socket.Attachment0 = a1
socket.Attachment1 = a2
a1.CFrame = descendant.C0
a2.CFrame = descendant.C1
socket.LimitsEnabled = true
socket.TwistLimitsEnabled = true
descendant:Destroy()
end
end
end)
end)
end)