Advertisement
subaru112g

ragdoll on death script(only on you)

Feb 3rd, 2019
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1.  
  2. Character = owner.Character
  3. Humanoid = Character:FindFirstChildOfClass("Humanoid")
  4. Torso = Character.Torso
  5.  
  6.  
  7.  
  8. function OnDeath()
  9.  
  10. for i,v in pairs(Character:GetChildren()) do
  11. if v.ClassName == "Script" or v.ClassName == "LocalScript" then
  12. if v ~= script then
  13. v:Destroy()
  14. end
  15. end
  16. end
  17.  
  18. print("Death")-- HAHA
  19. wait(0.00000001)
  20.  
  21. local newchar = Instance.new("Model",workspace)
  22. newchar.Name = Character.Name.."'s dead body"
  23.  
  24. Humanoid:Destroy()
  25. local Humanoid = Instance.new("Humanoid",newchar)
  26. Humanoid.MaxHealth = 0
  27. Humanoid.Health = 0
  28. Humanoid.PlatformStand = true
  29. Humanoid.Name = "dead"
  30.  
  31. for i,v in pairs(Character:GetChildren()) do
  32. if v.Name == "HumanoidRootPart" then
  33.  
  34. Character.HumanoidRootPart.CanCollide = false
  35. Character.HumanoidRootPart.Anchored = true
  36. Character.HumanoidRootPart.Parent = newchar
  37.  
  38. end
  39. end
  40.  
  41. if Torso then
  42. Torso.Parent = newchar
  43. local Head = Character:FindFirstChild("Head")
  44. if Head then
  45. Head.Parent = newchar
  46. local Neck = Instance.new("Weld")
  47. Neck.Name = "Neck"
  48. Neck.Part0 = Torso
  49. Neck.Part1 = Head
  50. Neck.C0 = CFrame.new(0, 1.5, 0)
  51. Neck.C1 = CFrame.new()
  52. Neck.Parent = Torso
  53. end
  54. local Limb = Character:FindFirstChild("Right Arm")
  55. if Limb then
  56. Limb.Parent = newchar
  57. Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0)
  58. local Joint = Instance.new("Glue")
  59. Joint.Name = "RightShoulder"
  60. Joint.Part0 = Torso
  61. Joint.Part1 = Limb
  62. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  63. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  64. Joint.Parent = Torso
  65.  
  66. local B = Instance.new("Part")
  67. B.TopSurface = 0
  68. B.BottomSurface = 0
  69. B.formFactor = "Symmetric"
  70. B.Size = Vector3.new(1, 1, 1)
  71. B.Transparency = 1
  72. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  73. B.Parent = Character
  74. local W = Instance.new("Weld")
  75. W.Part0 = Limb
  76. W.Part1 = B
  77. W.C0 = CFrame.new(0, -0.5, 0)
  78. W.Parent = Limb
  79.  
  80. end
  81. local Limb = Character:FindFirstChild("Left Arm")
  82. if Limb then
  83. Limb.Parent = newchar
  84. Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0)
  85. local Joint = Instance.new("Glue")
  86. Joint.Name = "LeftShoulder"
  87. Joint.Part0 = Torso
  88. Joint.Part1 = Limb
  89. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  90. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  91. Joint.Parent = Torso
  92.  
  93. local B = Instance.new("Part")
  94. B.TopSurface = 0
  95. B.BottomSurface = 0
  96. B.formFactor = "Symmetric"
  97. B.Size = Vector3.new(1, 1, 1)
  98. B.Transparency = 1
  99. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  100. B.Parent = Character
  101. local W = Instance.new("Weld")
  102. W.Part0 = Limb
  103. W.Part1 = B
  104. W.C0 = CFrame.new(0, -0.5, 0)
  105. W.Parent = Limb
  106.  
  107. end
  108. local Limb = Character:FindFirstChild("Right Leg")
  109. if Limb then
  110. Limb.Parent = newchar
  111. Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 0)
  112. local Joint = Instance.new("Glue")
  113. Joint.Name = "RightHip"
  114. Joint.Part0 = Torso
  115. Joint.Part1 = Limb
  116. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  117. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  118. Joint.Parent = Torso
  119.  
  120. local B = Instance.new("Part")
  121. B.TopSurface = 0
  122. B.BottomSurface = 0
  123. B.formFactor = "Symmetric"
  124. B.Size = Vector3.new(1, 1, 1)
  125. B.Transparency = 1
  126. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  127. B.Parent = Character
  128. local W = Instance.new("Weld")
  129. W.Part0 = Limb
  130. W.Part1 = B
  131. W.C0 = CFrame.new(0, -0.5, 0)
  132. W.Parent = Limb
  133.  
  134. end
  135. local Limb = Character:FindFirstChild("Left Leg")
  136. if Limb then
  137. Limb.Parent = newchar
  138. Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 0)
  139. local Joint = Instance.new("Glue")
  140. Joint.Name = "LeftHip"
  141. Joint.Part0 = Torso
  142. Joint.Part1 = Limb
  143. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  144. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  145. Joint.Parent = Torso
  146.  
  147. local B = Instance.new("Part")
  148. B.TopSurface = 0
  149. B.BottomSurface = 0
  150. B.formFactor = "Symmetric"
  151. B.Size = Vector3.new(1, 1, 1)
  152. B.Transparency = 1
  153. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  154. B.Parent = Character
  155. local W = Instance.new("Weld")
  156. W.Part0 = Limb
  157. W.Part1 = B
  158. W.C0 = CFrame.new(0, -0.5, 0)
  159. W.Parent = Limb
  160.  
  161.  
  162.  
  163. end
  164. --[
  165. for i,v in pairs(Character:GetChildren()) do
  166. if v.ClassName == "Accessory" or v.ClassName == "Hat" then
  167. v.Parent = game.Workspace
  168. v.Handle.Position = newchar.Head.Position
  169. v.Parent = newchar
  170. end
  171. end
  172.  
  173. for i,v in pairs(Character:GetChildren()) do
  174. v.Parent = newchar
  175. end
  176.  
  177.  
  178. local Bar = Instance.new("Part")
  179. Bar.TopSurface = 0
  180. Bar.BottomSurface = 0
  181. Bar.formFactor = "Symmetric"
  182. Bar.Size = Vector3.new(1, 1, 1)
  183. Bar.Transparency = 1
  184. Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0)
  185. Bar.Parent = newchar
  186. local Weld = Instance.new("Weld")
  187. Weld.Part0 = Torso
  188. Weld.Part1 = Bar
  189. Weld.C0 = CFrame.new(0, 0.5, 0)
  190. Weld.Parent = Torso
  191. --]]
  192. end
  193. end
  194.  
  195. Humanoid.Died:connect(OnDeath)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement