Mryeetmemes

2 ragdoll systems scripts (only for roblox)

May 18th, 2021
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. 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.  
  8. if joint:IsA ('Motor6D') then
  9. local socket = Instance.new('BallSocketConstraint')
  10. local a1 = Instance.new('Attachment')
  11. local a2 = Instance.new('Attachment')
  12. a1.Parent = joint.Part0
  13. a2.Parent = joint.Part1
  14. socket.Parent = joint.Parent
  15. socket.Attachment0 = a1
  16. socket.Attachment1 = a2
  17. a1.CFrame = joint.C0
  18. a2.CFrame = joint.C1
  19. socket.LimitsEnabled = true
  20. socket.TwistLimitsEnabled = true
  21. joint:Destroy()
  22. end
  23.  
  24. end
  25. end)
  26. 2. local humanoid = script.Parent:WaitForChild('Humanoid')
  27.  
  28. humanoid.BreakJointsOnDeath = false
  29.  
  30. humanoid.Died:Connect(function()
  31. for index,joint in pairs(script.Parent:GetDescendants()) do
  32.  
  33. if joint:IsA ('Motor6D') then
  34. local socket = Instance.new('BallSocketConstraint')
  35. local a1 = Instance.new('Attachment')
  36. local a2 = Instance.new('Attachment')
  37. a1.Parent = joint.Part0
  38. a2.Parent = joint.Part1
  39. socket.Parent = joint.Parent
  40. socket.Attachment0 = a1
  41. socket.Attachment1 = a2
  42. a1.CFrame = joint.C0
  43. a2.CFrame = joint.C1
  44. socket.LimitsEnabled = true
  45. socket.TwistLimitsEnabled = true
  46. joint:Destroy('Joints')
  47. attachment1 = a1
  48. attachment2 = a2
  49. a1 = player.Joints = Attachment1
  50. a2 = player.Joints = attachment2
  51. part.players = joints
  52. socket.Joints = a1
  53. socket.Joints = a2
  54. a1 = a2
  55. humanoid = a1.a2
  56.  
  57.  
  58. end
  59.  
  60. end
  61. end)
  62.  
Advertisement
Add Comment
Please, Sign In to add comment