Advertisement
spacemonkey3591

Testing Death

Jun 16th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.41 KB | None | 0 0
  1. function ragdoll()
  2. game.Players.LocalPlayer.Character.Archivable = true
  3. clone = game.Players.LocalPlayer.Character:Clone()
  4. clone.Parent = workspace
  5. for i,v in pairs(clone:GetChildren()) do
  6. if v.ClassName == "Script" or v.ClassName == "LocalScript" then
  7. v:destroy()
  8. end
  9. for i,p in pairs(v:GetChildren()) do
  10. if p.ClassName == "Weld" or p.ClassName == "Motor6D" or p.ClassName == "BodyVelocity" then
  11. p:destroy()
  12. end
  13. end
  14. end
  15. for i,t in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  16. if t.ClassName == "Accessory" or t.ClassName == "ForceField" then
  17. t:destroy()
  18. end
  19. end
  20. vel = Instance.new("BodyVelocity", clone.Torso)
  21. vel.Velocity = clone.Torso.CFrame.lookVector * -5
  22. vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  23. clone.Head.face.Texture = "http://www.roblox.com/asset/?id=161061608"
  24. using = false
  25. hit = Instance.new("Sound", clone.Torso)
  26. hit.SoundId = "rbxassetid://131280958"
  27. hit.Volume = 10
  28. hit1 = Instance.new("Sound", clone.Torso)
  29. hit1.SoundId = "rbxassetid://131280958"
  30. hit1.Volume = 10
  31. hit2 = Instance.new("Sound", clone.Torso)
  32. hit2.SoundId = "rbxassetid://131280958"
  33. hit2.Volume = 10
  34. hit3 = Instance.new("Sound", clone.Torso)
  35. hit3.SoundId = "rbxassetid://131280958"
  36. hit3.Volume = 10
  37. hit3.TimePosition = 0
  38. ded = Instance.new("Sound", clone.Torso)
  39. ded.SoundId = "rbxassetid://180479971"
  40. ded.Volume = 10
  41. local leftarm = clone:findFirstChild("Left Arm")
  42. local rightrm = clone:findFirstChild("Right Arm")
  43. local leftleg = clone:findFirstChild("Left Leg")
  44. local rightleg = clone:findFirstChild("Right Leg")
  45. local head = clone:findFirstChild("Head")
  46. local welding = Instance.new("Weld", clone.Torso)
  47. welding.Part0 = clone.Torso
  48. welding.Part1 = head
  49. welding.C0 = welding.C0 * CFrame.new(0,1.5,0)
  50. for i, g in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  51. if g.ClassName == "Part" then
  52. g:destroy()
  53. end
  54. end
  55. for i, h in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
  56. if h.ClassName == "Accesory" then
  57. h:destroy()
  58. end
  59. end
  60. game.Workspace.CurrentCamera.CameraSubject = head
  61. if leftleg ~= nil then
  62. local glue = Instance.new("Glue", clone.Torso)
  63. glue.Part0 = clone.Torso
  64. glue.Part1 = leftleg
  65. glue.Name = "Left leg"
  66. local collider = Instance.new("Part", leftleg)
  67. collider.Position = Vector3.new(0,999,0)
  68. collider.Size = Vector3.new(1.7, 1, 1)
  69. collider.Shape = "Cylinder"
  70. local weld = Instance.new("Weld", collider)
  71. weld.Part0 = leftleg
  72. weld.Part1 = collider
  73. weld.C0 = CFrame.Angles(0, 0, 80)
  74. collider.TopSurface = "Smooth"
  75. collider.BottomSurface = "Smooth"
  76. collider.formFactor = "Symmetric"
  77. glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  78. glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  79. collider.Transparency = 1
  80. end
  81. ------------
  82. if rightleg ~= nil then
  83. local glue1 = Instance.new("Glue", clone.Torso)
  84. glue1.Part0 = clone.Torso
  85. glue1.Part1 = rightleg
  86. glue1.Name = "Right leg"
  87. local collider1 = Instance.new("Part", rightleg)
  88. collider1.Position = Vector3.new(0,999,0)
  89. collider1.Size = Vector3.new(1.7, 1, 1)
  90. collider1.Shape = "Cylinder"
  91. local weld1 = Instance.new("Weld", collider1)
  92. weld1.Part0 = rightleg
  93. weld1.Part1 = collider1
  94. weld1.C0 = CFrame.Angles(0, 0, 80)
  95. collider1.TopSurface = "Smooth"
  96. collider1.BottomSurface = "Smooth"
  97. collider1.formFactor = "Symmetric"
  98. glue1.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  99. glue1.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  100. collider1.Transparency = 1
  101. end
  102. ------------
  103. if rightrm ~= nil then
  104. local glue11 = Instance.new("Glue", clone.Torso)
  105. glue11.Part0 = clone.Torso
  106. glue11.Part1 = rightrm
  107. glue11.Name = "Right shoulder"
  108. local collider11 = Instance.new("Part", rightrm)
  109. collider11.Position = Vector3.new(0,9999,0)
  110. collider11.Size = Vector3.new(1.8,1,1)
  111. collider11.Shape = "Cylinder"
  112. local weld11 = Instance.new("Weld", collider11)
  113. weld11.Part0 = rightrm
  114. weld11.Part1 = collider11
  115. weld11.C0 = CFrame.Angles(0, 0, 80)
  116. collider11.TopSurface = "Smooth"
  117. collider11.BottomSurface = "Smooth"
  118. collider11.formFactor = "Symmetric"
  119. glue11.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  120. glue11.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  121. collider11.Transparency = 1
  122. end
  123. ------------
  124. if leftarm ~= nil then
  125. local glue111 = Instance.new("Glue", clone.Torso)
  126. glue111.Part0 = clone.Torso
  127. glue111.Part1 = leftarm
  128. glue111.Name = "Left shoulder"
  129. local collider111 = Instance.new("Part", leftarm)
  130. collider111.Position = Vector3.new(0,9999,0)
  131. collider111.Size = Vector3.new(1.8,1,1)
  132. collider111.Shape = "Cylinder"
  133. local weld111 = Instance.new("Weld", collider111)
  134. weld111.Part0 = leftarm
  135. weld111.Part1 = collider111
  136. weld111.C0 = CFrame.Angles(0, 0, 80)
  137. collider111.TopSurface = "Smooth"
  138. collider111.BottomSurface = "Smooth"
  139. collider111.formFactor = "Symmetric"
  140. glue111.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  141. glue111.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  142. collider111.Transparency = 1
  143. ----------------
  144. sensoring = Instance.new("Part", clone.Torso)
  145. sensoring.Size = Vector3.new(1.2,1.1,0.8)
  146. sensoring.CanCollide = false
  147. sensoring.Position = clone.Torso.Position
  148. local welder = Instance.new("Weld", sensoring)
  149. welder.Part0 = clone.Torso
  150. welder.Part1 = sensoring
  151. welder.C0 = welder.C0 * CFrame.new(0,0,1.05)
  152. sensoring.Transparency = 1
  153. -----------------
  154. sensoring1 = Instance.new("Part", clone.Torso)
  155. sensoring1.Size = Vector3.new(1.2,1.1,0.8)
  156. sensoring1.CanCollide = false
  157. sensoring1.Position = clone.Torso.Position
  158. local welder1 = Instance.new("Weld", sensoring)
  159. welder1.Part0 = clone.Torso
  160. welder1.Part1 = sensoring1
  161. welder1.C0 = welder1.C0 * CFrame.new(0,0,-1.05)
  162. sensoring1.Transparency = 1
  163. end
  164. clone.Name = game.Players.LocalPlayer.Character.Name.." Ragdoll"
  165. ded:Play()
  166. vel:destroy()
  167. wait(0.5)
  168. local function touch()
  169. if not using then
  170. using = true
  171. local Math = math.random(1,4)
  172. if Math == 1 then
  173. hit:Play()
  174. end
  175. if Math == 2 then
  176. hit1:Play()
  177. end
  178. if Math == 3 then
  179. hit2:Play()
  180. end
  181. if Math == 4 then
  182. hit3:Play()
  183. end
  184. wait(0.1)
  185. using = false
  186. end
  187. end
  188. sensoring.Touched:connect(touch)
  189. sensoring1.Touched:connect(touch)
  190. wait(4.47)
  191. hit1.Volume = 0
  192. hit2.Volume = 0
  193. hit3.Volume = 0
  194. hit.Volume = 0
  195. end
  196.  
  197. game.Players.LocalPlayer.Character.Humanoid.Died:connect(ragdoll)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement