Advertisement
Navarone19_CH

Ragdoll

Nov 8th, 2020 (edited)
11,147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. local humanoid = script.Parent:WaitForChild("Humanoid")
  2.  
  3. humanoid.BreakJointsOnDeath = false
  4.  
  5. humanoid.Died:Connect(function()
  6. for index,joint in pairs(script.Parent:GetDescendants()) do
  7. if joint:IsA('Motor6D') then
  8. local socket = Instance.new('BallSocketConstraint')
  9. local a1 = Instance.new('Attachment')
  10. local a2 = Instance.new('Attachment')
  11. a1.Parent = joint.Part0
  12. a2.Parent = joint.Part1
  13. socket.Parent = joint.Parent
  14. socket.Attachment0 = a1
  15. socket.Attachment1 = a2
  16. a1.CFrame = joint.C0
  17. a2.CFrame = joint.C1
  18. socket.LimitsEnabled = true
  19. socket.TwistLimitsEnabled = true
  20. joint:Destroy()
  21. end
  22. end
  23. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement