Advertisement
Animescapetower

r6 ragdoll

Mar 28th, 2018
965
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.11 KB | None | 0 0
  1. --[[ This may take time, use this script in your own scripts just to add a ragdoll whenever you die, works for only r6 people
  2.  
  3. ]]
  4. HUMANOID = game.Players.LocalPlayer.Character.Humanoid
  5. wait()
  6. if HUMANOID.RigType ~= Enum.HumanoidRigType.R6 then
  7. game.Debris:AddItem(script,1)
  8. else
  9. wait()
  10. function getAttachment0(attachmentName)
  11. for _,child in next,script.Parent:GetChildren() do
  12. local attachment = child:FindFirstChild(attachmentName)
  13. if attachment then
  14. return attachment
  15. end
  16. end
  17. end
  18. HUMANOID.Died:Connect(function(var)
  19. local removeHRP = true
  20. local head = HUMANOID.Parent.Head
  21. local leftarm = HUMANOID.Parent["Left Arm"]
  22. local leftleg = HUMANOID.Parent["Left Leg"]
  23. local rightleg = HUMANOID.Parent["Right Leg"]
  24. local rightarm = HUMANOID.Parent["Right Arm"]
  25. local torso = HUMANOID.Parent.Torso
  26. local root =HUMANOID.Parent.HumanoidRootPart
  27. if removeHRP == true then
  28. root:Destroy()
  29. end
  30. local rootA =Instance.new("Attachment")
  31. local HeadA = Instance.new("Attachment")
  32. local LeftArmA = Instance.new("Attachment")
  33. local LeftLegA = Instance.new("Attachment")
  34. local RightArmA = Instance.new("Attachment")
  35. local RightLegA = Instance.new("Attachment")
  36. local TorsoA = Instance.new("Attachment")
  37. local TorsoA1 = Instance.new("Attachment")
  38. local TorsoA2 = Instance.new("Attachment")
  39. local TorsoA3 = Instance.new("Attachment")
  40. local TorsoA4 = Instance.new("Attachment")
  41. local TorsoA5 = Instance.new("Attachment")
  42. function set1()
  43. HeadA.Name = "HeadA"
  44. HeadA.Parent = head
  45. HeadA.Position = Vector3.new(0, -0.5, 0)
  46. HeadA.Rotation = Vector3.new(0, 0, 0)
  47. HeadA.Axis = Vector3.new(1, 0, 0)
  48. HeadA.SecondaryAxis = Vector3.new(0, 1, 0)
  49. LeftArmA.Name = "LeftArmA"
  50. LeftArmA.Parent = leftarm
  51. LeftArmA.Position = Vector3.new(0.5, 1, 0)
  52. LeftArmA.Rotation = Vector3.new(0, 0, 0)
  53. LeftArmA.Axis = Vector3.new(1, 0, 0)
  54. LeftArmA.SecondaryAxis = Vector3.new(0, 1, 0)
  55. LeftLegA.Name = "LeftLegA"
  56. LeftLegA.Parent = leftleg
  57. LeftLegA.Position = Vector3.new(0, 1, 0)
  58. LeftLegA.Rotation = Vector3.new(0, 0, 0)
  59. LeftLegA.Axis = Vector3.new(1, 0, 0)
  60. LeftLegA.SecondaryAxis = Vector3.new(0, 1, 0)
  61. RightArmA.Name = "RightArmA"
  62. RightArmA.Parent = rightarm
  63. RightArmA.Position = Vector3.new(-0.5, 1, 0)
  64. RightArmA.Rotation = Vector3.new(0, 0, 0)
  65. RightArmA.Axis = Vector3.new(1, 0, 0)
  66. RightArmA.SecondaryAxis = Vector3.new(0, 1, 0)
  67. RightLegA.Name = "RightLegA"
  68. RightLegA.Parent = rightleg
  69. RightLegA.Position = Vector3.new(0, 1, 0)
  70. RightLegA.Rotation = Vector3.new(0, 0, 0)
  71. RightLegA.Axis = Vector3.new(1, 0, 0)
  72. RightLegA.SecondaryAxis = Vector3.new(0, 1, 0)
  73. rootA.Name= "rootA"
  74. rootA.Parent = root
  75. rootA.Position = Vector3.new(0, 0, 0)
  76. rootA.Rotation = Vector3.new(0, 90, 0)
  77. rootA.Axis = Vector3.new(0, 0, -1)
  78. rootA.SecondaryAxis = Vector3.new(0, 1, 0)
  79. end
  80. function set2()
  81. TorsoA.Name = "TorsoA"
  82. TorsoA.Parent = torso
  83. TorsoA.Position = Vector3.new(0.5, -1, 0)
  84. TorsoA.Rotation = Vector3.new(0, 0, 0)
  85. TorsoA.Axis = Vector3.new(1, 0, 0)
  86. TorsoA.SecondaryAxis = Vector3.new(0, 1, 0)
  87. TorsoA1.Name = "TorsoA1"
  88. TorsoA1.Parent = torso
  89. TorsoA1.Position = Vector3.new(-0.5, -1, 0)
  90. TorsoA1.Rotation = Vector3.new(0, 0, 0)
  91. TorsoA1.Axis = Vector3.new(1, 0, 0)
  92. TorsoA1.SecondaryAxis = Vector3.new(0, 1, 0)
  93. TorsoA2.Name = "TorsoA2"
  94. TorsoA2.Parent = torso
  95. TorsoA2.Position = Vector3.new(-1, 1, 0)
  96. TorsoA2.Rotation = Vector3.new(0, 0, 0)
  97. TorsoA2.Axis = Vector3.new(1, 0, 0)
  98. TorsoA2.SecondaryAxis = Vector3.new(0, 1, 0)
  99. TorsoA3.Name = "TorsoA3"
  100. TorsoA3.Parent = torso
  101. TorsoA3.Position = Vector3.new(1, 1, 0)
  102. TorsoA3.Rotation = Vector3.new(0, 0, 0)
  103. TorsoA3.Axis = Vector3.new(1, 0, 0)
  104. TorsoA3.SecondaryAxis = Vector3.new(0, 1, 0)
  105. TorsoA4.Name = "TorsoA4"
  106. TorsoA4.Parent = torso
  107. TorsoA4.Position = Vector3.new(0, 1, 0)
  108. TorsoA4.Rotation = Vector3.new(0, 0, 0)
  109. TorsoA4.Axis = Vector3.new(1, 0, 0)
  110. TorsoA4.SecondaryAxis = Vector3.new(0, 1, 0)
  111. TorsoA5.Name = "TorsoA5"
  112. TorsoA5.Parent = torso
  113. TorsoA5.Position = Vector3.new(0, 0, 0)
  114. TorsoA5.Rotation = Vector3.new(0, 90, 0)
  115. TorsoA5.Axis = Vector3.new(0, 0, -1)
  116. TorsoA5.SecondaryAxis = Vector3.new(0, 1, 0)
  117. end
  118. function set3()
  119. end
  120. spawn(set1);
  121. spawn(set2);
  122. local HA = Instance.new("HingeConstraint")
  123. HA.Parent = head
  124. HA.Attachment0 = HeadA
  125. HA.Attachment1 = TorsoA4
  126. HA.Enabled = true
  127. HA.LimitsEnabled=true
  128. HA.LowerAngle=0
  129. HA.UpperAngle=0
  130. local LAT = Instance.new("BallSocketConstraint")
  131. LAT.Parent = leftarm
  132. LAT.Attachment0 = LeftArmA
  133. LAT.Attachment1 = TorsoA2
  134. LAT.Enabled = true
  135. LAT.LimitsEnabled=true
  136. LAT.UpperAngle=90
  137. local RAT = Instance.new("BallSocketConstraint")
  138. RAT.Parent = rightarm
  139. RAT.Attachment0 = RightArmA
  140. RAT.Attachment1 = TorsoA3
  141. RAT.Enabled = true
  142. RAT.LimitsEnabled=true
  143. RAT.UpperAngle=90
  144. local HA = Instance.new("BallSocketConstraint")
  145. HA.Parent = head
  146. HA.Attachment0 = HeadA
  147. HA.Attachment1 = TorsoA4
  148. HA.Enabled = true
  149. local TLL = Instance.new("BallSocketConstraint")
  150. TLL.Parent = torso
  151. TLL.Attachment0 = TorsoA1
  152. TLL.Attachment1 = LeftLegA
  153. TLL.Enabled = true
  154. TLL.LimitsEnabled=true
  155. TLL.UpperAngle=90
  156. local TRL = Instance.new("BallSocketConstraint")
  157. TRL.Parent = torso
  158. TRL.Attachment0 = TorsoA
  159. TRL.Attachment1 = RightLegA
  160. TRL.Enabled = true
  161. TRL.LimitsEnabled=true
  162. TRL.UpperAngle=90
  163. local RTA = Instance.new("BallSocketConstraint")
  164. RTA.Parent = root
  165. RTA.Attachment0 = rootA
  166. RTA.Attachment1 = TorsoA5
  167. RTA.Enabled = true
  168. RTA.LimitsEnabled=true
  169. RTA.UpperAngle=0
  170. head.Velocity = head.CFrame.lookVector*30
  171.  
  172. for _,child in next,script.Parent:GetChildren() do
  173. if child:IsA("Accoutrement") then
  174. for _,part in next,child:GetChildren() do
  175. if part:IsA("BasePart") then
  176. part.Parent = script.Parent
  177. child:remove()
  178. local attachment1 = part:FindFirstChildOfClass("Attachment")
  179. local attachment0 = getAttachment0(attachment1.Name)
  180. if attachment0 and attachment1 then
  181. local constraint = Instance.new("HingeConstraint")
  182. constraint.Attachment0 = attachment0
  183. constraint.Attachment1 = attachment1
  184. constraint.LimitsEnabled = true
  185. constraint.UpperAngle = 0
  186. constraint.LowerAngle = 0
  187. constraint.Parent = script.Parent
  188. end
  189. end
  190. end
  191. end
  192. end
  193. end)
  194. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement