Advertisement
HenloMyDude

r6 ragdoll function

Dec 1st, 2019
422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. function ragdollold(model, ragdolltime)
  2. local ragged = Instance.new("NumberValue",model)
  3. ragged.Name = "ragged"
  4. game.Debris:AddItem(ragged, ragdolltime)
  5. local torso = model:FindFirstChild("Torso") or model:FindFirstChild("UpperTorso")
  6. for i,v in pairs (model:GetDescendants()) do
  7. if v:IsA("Motor") or v:IsA("Motor6D") then
  8. if v.Name == "Right Shoulder" then
  9. old = v.Parent
  10. local glue = Instance.new("Glue",old)
  11. glue.Part0 = v.Part0
  12. glue.Part1 = v.Part1
  13. glue.C0 = v.C0
  14. glue.C1 = v.C1
  15. v.Parent = nil
  16. game.Debris:AddItem(glue, ragdolltime)
  17. if model:FindFirstChild("Right Arm") then
  18. local ack = model["Right Arm"]
  19. local hitbox = ack:Clone()
  20. hitbox.Parent = ack
  21. hitbox.Size = ack.Size
  22. hitbox.Transparency = 1
  23. hitbox.CanCollide = true
  24. hitbox.Anchored = false
  25. ezweld(hitbox, hitbox, ack, CFrame.new())
  26. game.Debris:AddItem(hitbox, ragdolltime)
  27. end
  28. coroutine.resume(coroutine.create(function()
  29. wait(ragdolltime)
  30. v.Parent = old
  31. end))
  32. end
  33. if v.Name == "Left Shoulder" then
  34. old = v.Parent
  35. local glue = Instance.new("Glue",old)
  36. glue.Part0 = v.Part0
  37. glue.Part1 = v.Part1
  38. glue.C0 = v.C0
  39. glue.C1 = v.C1
  40. v.Parent = nil
  41. game.Debris:AddItem(glue, ragdolltime)
  42. if model:FindFirstChild("Left Arm") then
  43. local ack = model["Left Arm"]
  44. local hitbox = ack:Clone()
  45. hitbox.Parent = ack
  46. hitbox.Size = ack.Size
  47. hitbox.Transparency = 1
  48. hitbox.CanCollide = true
  49. hitbox.Anchored = false
  50. ezweld(hitbox, hitbox, ack, CFrame.new())
  51. game.Debris:AddItem(hitbox, ragdolltime)
  52. end
  53. coroutine.resume(coroutine.create(function()
  54. wait(ragdolltime)
  55. v.Parent = old
  56. end))
  57. end
  58. if v.Name == "Right Hip" then
  59. old = v.Parent
  60. local glue = Instance.new("Glue",old)
  61. glue.Part0 = v.Part0
  62. glue.Part1 = v.Part1
  63. glue.C0 = v.C0
  64. glue.C1 = v.C1
  65. v.Parent = nil
  66. game.Debris:AddItem(glue, ragdolltime)
  67. if model:FindFirstChild("Right Leg") then
  68. local ack = model["Right Leg"]
  69. local hitbox = ack:Clone()
  70. hitbox.Parent = ack
  71. hitbox.Size = ack.Size
  72. hitbox.Transparency = 1
  73. hitbox.CanCollide = true
  74. hitbox.Anchored = false
  75. ezweld(hitbox, hitbox, ack, CFrame.new())
  76. game.Debris:AddItem(hitbox, ragdolltime)
  77. end
  78. coroutine.resume(coroutine.create(function()
  79. wait(ragdolltime)
  80. v.Parent = old
  81. end))
  82. end
  83. if v.Name == "Left Hip" then
  84. old = v.Parent
  85. local glue = Instance.new("Glue",old)
  86. glue.Part0 = v.Part0
  87. glue.Part1 = v.Part1
  88. glue.C0 = v.C0
  89. glue.C1 = v.C1
  90. v.Parent = nil
  91. game.Debris:AddItem(glue, ragdolltime)
  92. if model:FindFirstChild("Left Leg") then
  93. local ack = model["Left Leg"]
  94. local hitbox = ack:Clone()
  95. hitbox.Parent = ack
  96. hitbox.Size = ack.Size
  97. hitbox.Transparency = 1
  98. hitbox.CanCollide = true
  99. hitbox.Anchored = false
  100. ezweld(hitbox, hitbox, ack, CFrame.new())
  101. game.Debris:AddItem(hitbox, ragdolltime)
  102. end
  103. coroutine.resume(coroutine.create(function()
  104. wait(ragdolltime)
  105. v.Parent = old
  106. end))
  107. end
  108. end
  109. if v:IsA("Humanoid") then
  110. v.PlatformStand = true
  111. coroutine.resume(coroutine.create(function()
  112. wait(ragdolltime)
  113. v.PlatformStand = false
  114. end))
  115. end
  116. if v:IsA("Part") and v.Name == "Torso" then
  117. local a = 60
  118. v.Velocity = Vector3.new(math.random(-a, a), math.random(-a, a), math.random(-a, a))
  119. end
  120. end
  121. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement