Advertisement
TheUnknownDiscord

fall and die

May 3rd, 2022 (edited)
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.58 KB | None | 0 0
  1. function ragdoll()
  2. owner.Character.Humanoid.RequiresNeck = false
  3. local limbcollider = Instance.new("Part", owner.Character:findFirstChild("Right Arm"))
  4. limbcollider.Size = Vector3.new(1.4,1,1)
  5. limbcollider.Transparency = 1
  6. limbcollider.Name = "LimbCollider"
  7. local limbcolliderweld = Instance.new("Weld", limbcollider)
  8. limbcolliderweld.Part0 = owner.Character:findFirstChild("Right Arm")
  9. limbcolliderweld.Part1 = limbcollider
  10. limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  11. local limbcollider2 = Instance.new("Part", owner.Character:findFirstChild("Left Arm"))
  12. limbcollider2.Size = Vector3.new(1.4,1,1)
  13. limbcollider2.Transparency = 1
  14. limbcollider2.Name = "LimbCollider"
  15. local limbcolliderweld2 = Instance.new("Weld", limbcollider2)
  16. limbcolliderweld2.Part0 = owner.Character:findFirstChild("Left Arm")
  17. limbcolliderweld2.Part1 = limbcollider2
  18. limbcolliderweld2.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  19. local limbcollider3 = Instance.new("Part", owner.Character.Head)
  20. limbcollider3.Size = Vector3.new(0.5,0.5,0.5)
  21. limbcollider3.Shape = "Ball"
  22. limbcollider3.Transparency = 1
  23. limbcollider3.Name = "LimbCollider"
  24. local limbcolliderweld = Instance.new("Weld", limbcollider3)
  25. limbcolliderweld.Part0 = owner.Character.Head
  26. limbcolliderweld.Part1 = limbcollider3
  27. limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  28. for i,v in pairs(owner.Character:GetDescendants()) do
  29. pcall(function()
  30. if v:IsA("Motor6D") then
  31. v.Enabled = false
  32. end
  33. end)
  34. end
  35. local Socket = Instance.new("BallSocketConstraint")
  36. local a1 = Instance.new("Attachment")
  37. local a2 = Instance.new("Attachment")
  38. a1.Parent = owner.Character["Left Arm"]
  39. a2.Parent = owner.Character.Torso
  40. Socket.Parent = owner.Character["Left Arm"]
  41. Socket.Attachment0 = a1
  42. Socket.Attachment1 = a2
  43. a1.CFrame = CFrame.new(0,0.45,0)
  44. a2.CFrame = CFrame.new(-1.5,0.65,0)
  45. Socket.LimitsEnabled = true
  46. local Socket = Instance.new("BallSocketConstraint")
  47. local a1 = Instance.new("Attachment")
  48. local a2 = Instance.new("Attachment")
  49. a1.Parent = owner.Character["Left Leg"]
  50. a2.Parent = owner.Character.Torso
  51. Socket.Parent = owner.Character["Left Leg"]
  52. Socket.Attachment0 = a1
  53. Socket.Attachment1 = a2
  54. a1.CFrame = CFrame.new(0.1,0.5,0.1)
  55. a2.CFrame = CFrame.new(-0.45,-1.5,-0.1)
  56. Socket.LimitsEnabled = true
  57. local Socket = Instance.new("BallSocketConstraint")
  58. local a1 = Instance.new("Attachment")
  59. local a2 = Instance.new("Attachment")
  60. a1.Parent = owner.Character["Right Leg"]
  61. a2.Parent = owner.Character.Torso
  62. Socket.Parent = owner.Character["Right Leg"]
  63. Socket.Attachment0 = a1
  64. Socket.Attachment1 = a2
  65. Socket.LimitsEnabled = true
  66. a1.CFrame = CFrame.new(-0.1,0.5,0.1)
  67. a2.CFrame =CFrame.new(0.45,-1.5,-0.1)
  68. local limbcollider = Instance.new("Part", owner.Character:findFirstChild("Right Leg"))
  69. limbcollider.Size = Vector3.new(1.4,1,1)
  70. limbcollider.Transparency = 1
  71. limbcollider.Name = "LimbCollider"
  72. local limbcolliderweld = Instance.new("Weld", limbcollider)
  73. limbcolliderweld.Part0 = owner.Character:findFirstChild("Right Leg")
  74. limbcolliderweld.Part1 = limbcollider
  75. limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  76. local limbcollider2 = Instance.new("Part", owner.Character:findFirstChild("Left Leg"))
  77. limbcollider2.Size = Vector3.new(1.4,1,1)
  78. limbcollider2.Transparency = 1
  79. limbcollider2.Name = "LimbCollider"
  80. local limbcolliderweld2 = Instance.new("Weld", limbcollider2)
  81. limbcolliderweld2.Part0 = owner.Character:findFirstChild("Left Leg")
  82. limbcolliderweld2.Part1 = limbcollider2
  83. limbcolliderweld2.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.3,0,0)
  84. local Socket = Instance.new("BallSocketConstraint")
  85. local a1 = Instance.new("Attachment")
  86. local a2 = Instance.new("Attachment")
  87. a1.Parent = owner.Character.HumanoidRootPart
  88. a2.Parent = owner.Character.Torso
  89. Socket.Parent = owner.Character.HumanoidRootPart
  90. Socket.Attachment0 = a1
  91. Socket.Attachment1 = a2
  92. Socket.LimitsEnabled = true
  93. local Socket = Instance.new("BallSocketConstraint")
  94. local a1 = Instance.new("Attachment")
  95. local a2 = Instance.new("Attachment")
  96. a1.Parent = owner.Character.Head
  97. a2.Parent = owner.Character.Torso
  98. Socket.Parent = owner.Character.Head
  99. Socket.Attachment0 = a1
  100. Socket.Attachment1 = a2
  101. a1.CFrame = CFrame.new(0,-0.5,0)
  102. a2.CFrame = CFrame.new(0,1.0625,0)
  103. Socket.TwistLimitsEnabled = true
  104. Socket.LimitsEnabled = true
  105. local Socket = Instance.new("BallSocketConstraint")
  106. local a1 = Instance.new("Attachment")
  107. local a2 = Instance.new("Attachment")
  108. a1.Parent = owner.Character["Right Arm"]
  109. a2.Parent = owner.Character.Torso
  110. Socket.Parent = owner.Character["Right Arm"]
  111. Socket.Attachment0 = a1
  112. Socket.Attachment1 = a2
  113. a1.CFrame = CFrame.new(0,0.45,0)
  114. a2.CFrame = CFrame.new(1.5,0.65,0)
  115. Socket.LimitsEnabled = true
  116. owner.Character.Humanoid.PlatformStand = true
  117. end
  118. function getup()
  119. for i,v in pairs(owner.Character:GetDescendants()) do
  120. if v:IsA("BasePart") and v.Name == "LimbCollider" then
  121. v:Destroy()
  122. elseif v:IsA("BallSocketConstraint") then
  123. v:Destroy()
  124. elseif v:IsA("Motor6D") then
  125. v.Enabled = true
  126. end
  127. end
  128. owner.Character.Humanoid.RequiresNeck = true
  129. owner.Character.Humanoid.PlatformStand = false
  130. end
  131. local rayblacklist = {}
  132. local p = Instance.new("SpawnLocation")
  133. p.Enabled = false
  134. p.Transparency = 1
  135. p.Size = Vector3.new(0.25,0.25,0.25)
  136. p.Name = "bloodyhujijahuyugtfvfyh"
  137. local attachment0 = Instance.new("Attachment",p)
  138. local attachment1 = Instance.new("Attachment",p)
  139. attachment1.CFrame = CFrame.new(0,0.125,0)
  140. attachment0.CFrame = CFrame.new(0,-0.125,0)
  141. local trail = Instance.new("Trail",p)
  142. trail.Attachment0 = attachment0
  143. trail.Attachment1 = attachment1
  144. trail.Lifetime = .5
  145. trail.Transparency = NumberSequence.new{NumberSequenceKeypoint.new(0, 0),NumberSequenceKeypoint.new(1, 1)}
  146. trail.WidthScale = NumberSequence.new{NumberSequenceKeypoint.new(0, 1),NumberSequenceKeypoint.new(1, 0)}
  147. trail.MaxLength = 0
  148. trail.MinLength = 0.1
  149. trail.LightEmission = 0
  150. trail.LightInfluence = 1
  151. trail.TextureLength = 1
  152. trail.TextureMode = "Stretch"
  153. trail.Color = ColorSequence.new(Color3.fromRGB(85, 0, 0))
  154. local min = -15
  155. local max = 15
  156. function splat(whatpart,times)
  157. for i = 1,(2 * times) do
  158. task.wait()
  159. coroutine.wrap(function()
  160. local b = p:Clone()
  161. b.Parent = script
  162. b.Position = whatpart.Position + Vector3.new(whatpart.Velocity.X,0,whatpart.Velocity.Z) * owner:GetNetworkPing()
  163. b.Velocity = Vector3.new(Random.new():NextNumber(min,max),Random.new():NextNumber(min,max) + 30,Random.new():NextNumber(min,max)) + whatpart.Velocity * owner:GetNetworkPing()
  164. table.insert(rayblacklist,b)
  165. b.Touched:Connect(function(what)
  166. if not (what:FindFirstAncestorWhichIsA("Model") and what:FindFirstAncestorWhichIsA("Model"):FindFirstChildWhichIsA("Humanoid")) and not table.find(rayblacklist,what) and what.CanCollide then
  167. local params = RaycastParams.new()
  168. params.FilterDescendantsInstances = {rayblacklist,whatpart:FindFirstAncestorWhichIsA("Model"):GetDescendants()}
  169. params.FilterType = Enum.RaycastFilterType.Blacklist
  170. local result = workspace:Raycast(b.Position,b.Velocity + Vector3.new(0,-3,0), params)
  171. if result then
  172. local bloodpartfloor = Instance.new("SpawnLocation", workspace)
  173. bloodpartfloor.Enabled = false
  174. bloodpartfloor.CanCollide = false
  175. bloodpartfloor.Anchored = true
  176. table.insert(rayblacklist,bloodpartfloor)
  177. bloodpartfloor.Size = Vector3.new(0.005,0.005,0.005)
  178. bloodpartfloor.CanCollide = false
  179. bloodpartfloor.Material = "Glass"
  180. bloodpartfloor.Shape = "Cylinder"
  181. b:Destroy()
  182. bloodpartfloor.Position = result.Position
  183. local whathit = result.Instance
  184. local currentRightVector = whathit.CFrame.RightVector
  185. local upVector = result.Normal
  186. local newFacialVector = currentRightVector:Cross(upVector)
  187. bloodpartfloor.CFrame = CFrame.fromMatrix(bloodpartfloor.Position, currentRightVector, upVector, newFacialVector) * CFrame.Angles(0,0,math.rad(90))
  188. bloodpartfloor.BrickColor = BrickColor.new("Maroon")
  189. game:GetService("Debris"):AddItem(bloodpartfloor,25)
  190. local random = Random.new():NextNumber(0.25,2)
  191. local tweenService = game:GetService("TweenService")
  192. local timeToFade = .25
  193. local object = bloodpartfloor
  194. local tweenInfo = TweenInfo.new(timeToFade)
  195. local goal = {}
  196. goal.Size = Vector3.new(0.005,random,random)
  197. local grow = tweenService:Create(object, tweenInfo, goal)
  198. grow:Play()
  199. end
  200. end
  201. end)
  202. end)()
  203. end
  204. end
  205. fall = {1106908323,1080610583,1106908778}
  206. local ow = Instance.new("Sound", owner.Character.Head)
  207. ow.Volume = 2
  208. headshotids = {6837727169, 6837727725, 6837726415,6837724677,6837689373,6837725727}
  209. local bodyhit = Instance.new("Sound", owner.Character.Torso)
  210. bodyhit.SoundId = "rbxassetid://220025741"
  211. bodyhit.Volume = 2
  212. coroutine.wrap(function()
  213. while true do
  214. while owner.Character.Torso.Velocity.y >= -70 do
  215. task.wait()
  216. end
  217. while owner.Character.Torso.Velocity.y < -10 do
  218. task.wait()
  219. end
  220. local rand = math.random(1,#headshotids)
  221. bodyhit.SoundId = "rbxassetid://"..headshotids[rand]
  222. bodyhit.TimePosition = 0.2
  223. bodyhit:Play()
  224. bodyhit.Ended:Wait(0.0625)
  225. end
  226. end)()
  227. local falldb = false
  228. local falldb2 = false
  229. local currentheight = 0
  230. local maxheight = 0
  231. owner.Character.Humanoid.Touched:Connect(function(what,limb)
  232. if falldb and what.Name ~= "LimbCollider" and limb.Name ~= "LimbCollider" and what.Name ~= "bloodyhujijahuyugtfvfyh" and what.CanCollide and not table.find(rayblacklist,what) and limb.Velocity.y < -5 and what.Parent ~= owner.Character then
  233. splat(limb,math.random(2,3))
  234. owner.Character.Humanoid.Health -= ((math.abs(maxheight) - math.abs(currentheight)))
  235. maxheight = owner.Character.Torso.Position.Y
  236. currentheight = owner.Character.Torso.Position.Y
  237. end
  238. end)
  239. coroutine.wrap(function()
  240. while task.wait() do
  241. if maxheight < owner.Character.Torso.Position.Y then
  242. maxheight = owner.Character.Torso.Position.Y
  243. end
  244. currentheight = owner.Character.Torso.Position.Y
  245. end
  246. end)()
  247. coroutine.wrap(function()
  248. while true do
  249. task.wait()
  250. if not falldb and not falldb2 then
  251. while owner.Character.Torso.Velocity.y >= -70 and owner.Character.Torso.Velocity.y <= 60 do
  252. task.wait()
  253. end
  254. falldb2 = true
  255. ragdoll()
  256. local sound = "rbxassetid://"..fall[math.random(1,3)]
  257. ow.Volume = 2
  258. if sound ~= ow.SoundId then
  259. ow.SoundId = sound
  260. else
  261. repeat
  262. task.wait()
  263. sound = "rbxassetid://"..fall[math.random(1,3)]
  264. until sound ~= ow.SoundId
  265. ow.SoundId = sound
  266. end
  267. ow:Play()
  268. end
  269. end
  270. end)()
  271. coroutine.wrap(function()
  272. while true do
  273. if not falldb then
  274. while owner.Character.Torso.Velocity.y >= -70 do
  275. task.wait()
  276. end
  277. task.wait()
  278. falldb = true
  279. repeat
  280. task.wait()
  281. until (owner.Character.Head.Position - (owner.Character.Head.Position + owner.Character.Head.Velocity)).Magnitude <= 1
  282. falldb = false
  283. coroutine.wrap(function()
  284. for i = 1, 5 do
  285. if not falldb then
  286. task.wait()
  287. ow.Volume = 2 - (i * 0.4)
  288. end
  289. end
  290. ow:Stop()
  291. end)()
  292. wait(6)
  293. getup()
  294. falldb2 = false
  295. end
  296. task.wait()
  297. end
  298. end)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement