TheUnknownDiscord

ragdoll clone

Dec 13th, 2021 (edited)
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.29 KB | None | 0 0
  1. owner.Character.Archivable = true
  2. local Characters = owner.Character:Clone()
  3. Characters.Parent = workspace
  4. owner.Character.Archivable = false
  5. function bones(limb)
  6. coroutine.wrap(function()
  7. local bone = Instance.new("Part", limb)
  8. bone:BreakJoints()
  9. bone.Massless = true
  10. pcall(function()
  11. bone:SetNetworkOwner(limb.Parent.Parent)
  12. end)
  13. local bonew = Instance.new("Weld", bone)
  14. bonew.Part0 = limb
  15. bonew.Part1 = bone
  16. bonew.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-limb.Size.y/4.5,0,0)
  17. if limb.Parent:FindFirstChildOfClass("Humanoid").RigType == Enum.HumanoidRigType.R6 then
  18. bone.Size = Vector3.new(limb.Size.y/1.8,limb.Size.z,limb.Size.x)
  19. else
  20. bone.Size = Vector3.new(limb.Size.y/3,limb.Size.z,limb.Size.x)
  21. end
  22. bone.Transparency = 1
  23. bone.Shape = "Cylinder"
  24. end)()
  25. end
  26. function kill(Character)
  27. coroutine.wrap(function()
  28. pcall(function()
  29. local nek = Character.Humanoid.RequiresNeck
  30. Character.Humanoid.RequiresNeck = false
  31. Character.Humanoid.PlatformStand = true
  32. for i,v in pairs(Character:GetDescendants()) do
  33. if v:IsA("Motor6D") then
  34. v.Enabled = false
  35. end
  36. end
  37. if not Character:findFirstChild("UpperTorso") then
  38. coroutine.wrap(function()
  39. local Socket = Instance.new("BallSocketConstraint")
  40. local a1 = Instance.new("Attachment")
  41. local a2 = Instance.new("Attachment")
  42. a1.Parent = Character["Left Arm"]
  43. a2.Parent = Character.Torso
  44. Socket.Parent = Character["Left Arm"]
  45. Socket.Attachment0 = a1
  46. Socket.Attachment1 = a2
  47. a1.WorldCFrame = a1.Parent.CFrame * CFrame.new(0,0.5,0)
  48. a2.WorldCFrame = a2.Parent.CFrame * CFrame.new(-1.5,0.5,0)
  49. Socket.LimitsEnabled = true
  50. local Socket = Instance.new("BallSocketConstraint")
  51. local a1 = Instance.new("Attachment")
  52. local a2 = Instance.new("Attachment")
  53. a1.Parent = Character["Left Leg"]
  54. a2.Parent = Character.Torso
  55. Socket.Parent = Character["Left Leg"]
  56. Socket.Attachment0 = a1
  57. Socket.Attachment1 = a2
  58. a1.WorldCFrame = a1.Parent.CFrame * CFrame.new(0,0.5,0)
  59. a2.WorldCFrame = a2.Parent.CFrame * CFrame.new(-0.5,-1.5,0)
  60. Socket.LimitsEnabled = true
  61. local Socket = Instance.new("BallSocketConstraint")
  62. local a1 = Instance.new("Attachment")
  63. local a2 = Instance.new("Attachment")
  64. a1.Parent = Character["Right Leg"]
  65. a2.Parent = Character.Torso
  66. Socket.Parent = Character["Right Leg"]
  67. Socket.Attachment0 = a1
  68. Socket.Attachment1 = a2
  69. Socket.LimitsEnabled = true
  70. a1.WorldCFrame = a1.Parent.CFrame * CFrame.new(0,0.5,0)
  71. a2.WorldCFrame = a2.Parent.CFrame * CFrame.new(0.5,-1.5,0)
  72. local Socket = Instance.new("BallSocketConstraint")
  73. local a1 = Instance.new("Attachment")
  74. local a2 = Instance.new("Attachment")
  75. a1.Parent = Character.HumanoidRootPart
  76. a2.Parent = Character.Torso
  77. Socket.Parent = Character.HumanoidRootPart
  78. Socket.Attachment0 = a1
  79. Socket.Attachment1 = a2
  80. a1.WorldCFrame = a1.Parent.CFrame
  81. a2.WorldCFrame = a1.Parent.CFrame
  82. Socket.LimitsEnabled = true
  83. local Socket = Instance.new("BallSocketConstraint")
  84. local a1 = Instance.new("Attachment")
  85. local a2 = Instance.new("Attachment")
  86. a1.Parent = Character.Head
  87. a2.Parent = Character.Torso
  88. Socket.Parent = Character.Head
  89. Socket.Attachment0 = a1
  90. Socket.Attachment1 = a2
  91. a1.WorldCFrame = a1.Parent.CFrame * CFrame.new(0,-0.5,0)
  92. a2.WorldCFrame = a2.Parent.CFrame * CFrame.new(0,1.0625,0)
  93. Socket.TwistLimitsEnabled = true
  94. Socket.LimitsEnabled = true
  95. local Socket = Instance.new("BallSocketConstraint")
  96. local a1 = Instance.new("Attachment")
  97. local a2 = Instance.new("Attachment")
  98. a1.Parent = Character["Right Arm"]
  99. a2.Parent = Character.Torso
  100. Socket.Parent = Character["Right Arm"]
  101. Socket.Attachment0 = a1
  102. Socket.Attachment1 = a2
  103. a1.WorldCFrame = a1.Parent.CFrame * CFrame.new(0,0.5,0)
  104. a2.WorldCFrame = a2.Parent.CFrame * CFrame.new(1.5,0.5,0)
  105. Socket.LimitsEnabled = true
  106. end)()
  107. coroutine.wrap(function()
  108. local ch = Character
  109. bones(ch["Left Arm"])
  110. bones(ch["Right Arm"])
  111. bones(ch["Left Leg"])
  112. bones(ch["Right Leg"])
  113. bones(ch.Head)
  114. end)()
  115. else
  116. coroutine.wrap(function()
  117. local ch = Character
  118. bones(ch.LeftUpperArm)
  119. bones(ch.LeftLowerArm)
  120. bones(ch.RightUpperArm)
  121. bones(ch.RightLowerArm)
  122. bones(ch.LeftUpperLeg)
  123. bones(ch.LeftLowerLeg)
  124. bones(ch.RightUpperLeg)
  125. bones(ch.RightLowerLeg)
  126. bones(ch.Head)
  127. end)()
  128. for i,v in pairs(Character:GetDescendants()) do
  129. if v:IsA("Motor6D") and v.Parent.Name ~= "HumanoidRootPart" then
  130. local Socket = Instance.new("BallSocketConstraint")
  131. local a1 = Instance.new("Attachment")
  132. local a2 = Instance.new("Attachment")
  133. a1.Parent = v.Part0
  134. a2.Parent = v.Part1
  135. Socket.Parent = v.Parent
  136. Socket.Attachment0 = a1
  137. Socket.Attachment1 = a2
  138. a1.CFrame = v.C0
  139. a2.CFrame = v.C1
  140. Socket.LimitsEnabled = true
  141. Socket.TwistLimitsEnabled = true
  142. end
  143. end
  144. end
  145. end)
  146. end)()
  147. end
  148. kill(Characters)
  149. headshotids = {6837727169, 6837727725, 6837726415,6837724677,6837689373,6837725727}
  150. local bodyhit = Instance.new("Sound", Characters.Head)
  151. bodyhit.SoundId = "rbxassetid://220025741"
  152. bodyhit.Volume = 2
  153. coroutine.wrap(function()
  154. while true do
  155. while Characters.Head.Velocity.y >= -10 do
  156. task.wait()
  157. end
  158. while Characters.Head.Velocity.y < -10 do
  159. task.wait()
  160. end
  161. local rand = math.random(1,#headshotids)
  162. bodyhit.SoundId = "rbxassetid://"..headshotids[rand]
  163. bodyhit.TimePosition = 0.2
  164. bodyhit:Play()
  165. bodyhit.Ended:Wait(0.0625)
  166. end
  167. end)()
Add Comment
Please, Sign In to add comment