Advertisement
KrYn0MoRe

pain engine v0.9.2

Nov 28th, 2020 (edited)
1,787
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 38.28 KB | None | 0 0
  1. local studspermeters = 20
  2. local fatal_vel = studspermeters*15
  3. local terminal_vel = studspermeters*16
  4. local fallstates = {
  5.     Enum.HumanoidStateType.Freefall,
  6.     Enum.HumanoidStateType.FallingDown,
  7.     Enum.HumanoidStateType.Flying,
  8.     Enum.HumanoidStateType.Jumping,
  9. }
  10. local bleeding = {}
  11. local falling = {}
  12. local ragdolled = {}
  13. local gores1 = {3739335394,3737268126,3929462189,3739335007}
  14. local gores2 = {3847883680,3847884467,3847885772,3929462677}
  15. local gores3 = {4953187368,4953187704}
  16. local pg = {1489922915,1489934368}
  17. local stuns = {
  18.     5169623605,
  19.     5169624072,
  20.     5169626214,
  21.     5169624072,
  22.     5169623821,
  23.     5169626595
  24. }
  25. local impacts = {
  26.     3848124871,
  27.     3848125583,
  28.     3848126035,
  29.     3929466751
  30. }
  31. if not _G['ignore pain engine'] then
  32.     _G['ignore pain engine'] = {}
  33. end
  34.  
  35. function check_fatal(hum,dmg)
  36.     if 0 >= (hum.Health - dmg) then
  37.         return true
  38.     end
  39.     return false
  40. end
  41.  
  42. function check_godded(hum,lasthp)
  43.     if lasthp then
  44.         if lasthp > hum.Health then
  45.             return true
  46.         end
  47.     elseif hum.MaxHealth >= math.huge or hum.MaxHealth >= 1/0 then
  48.         return true
  49.     elseif hum.Parent:FindFirstChildOfClass("ForceField") then
  50.         return true
  51.     end
  52. end
  53.  
  54. function is_enabled(plr)
  55.     if _G['ignore pain engine'][plr.UserId] then
  56.         return true
  57.     elseif _G['ignore pain engine'][plr.UserId] == nil then
  58.         return true
  59.     else
  60.         return false
  61.     end
  62. end
  63.  
  64. function toggle_enable(plr,bool)
  65.     _G['ignore pain engine'][plr.UserId] = bool
  66. end
  67.  
  68. local junk = Instance.new("Folder",script)
  69.  
  70. function bleed2(plr,frick,targhum,can_hurt,t,splat,dir)
  71.     coroutine.resume(coroutine.create(function()
  72.         if frick and targhum then else return end
  73.         local rig = targhum.RigType
  74.         local limbs = {'Head','Left Arm','Right Arm','Left Leg','Right Leg','RightUpperLeg','LeftUpperLeg','RightUpperArm','LeftUpperArm','RightLowerLeg','LeftLowerLeg','RightLowerArm','LeftLowerArm','RightFoot','LeftFoot','RightHand','LeftHand'}
  75.         local interval_bleed = 0.1
  76.         if not bleeding[frick] or 0 >= bleeding[frick] then
  77.             bleeding[frick] = 0
  78.             bleeding[frick] = bleeding[frick] + t
  79.         elseif bleeding[frick] > 0 then
  80.             bleeding[frick] = bleeding[frick] + t
  81.             return
  82.         else
  83.             return
  84.         end
  85.         while bleeding[frick] > 0 do
  86.             if (not frick or not frick.Parent or not frick.Parent.Parent or not targhum or not targhum.Parent) then
  87.                 break
  88.             end
  89.             local max_limbs = 0
  90.             local current_limbs = 0
  91.             local gone_limbs = 0
  92.             local targchar = targhum.Parent
  93.             if rig == Enum.HumanoidRigType.R6 then
  94.                 max_limbs = 5
  95.             elseif rig == Enum.HumanoidRigType.R15 then
  96.                 max_limbs = 13
  97.             end
  98.             for i,v in pairs(targchar:GetChildren()) do
  99.                 local found = false
  100.                 for i,n in pairs(limbs) do if n == v.Name then found = true; end; end;
  101.                 if found and not v:FindFirstChild("Dismembered") then
  102.                     current_limbs = current_limbs + 1
  103.                 end
  104.             end
  105.             gone_limbs = (max_limbs-current_limbs)
  106.             if targhum and can_hurt then
  107.                 local bdmg = 0.3
  108.                 local multi = 3
  109.                 if 0 >= gone_limbs then
  110.                     gone_limbs = 1
  111.                 else
  112.                     gone_limbs = gone_limbs*multi
  113.                 end
  114.                 if 0 >= (targhum.Health - bdmg*gone_limbs) then
  115.                     targhum.BreakJointsOnDeath = false
  116.                     --[[
  117.                     pcall(function()
  118.                         kill(plr,targchar,dir,5)
  119.                     end)
  120.                     ]]
  121.                 end
  122.                 targhum:TakeDamage(bdmg*gone_limbs)
  123.             end
  124.             local vel = (dir*0.5)+Vector3.new(math.random(-5, 5)/40,math.random(-5, 5)/30,math.random(-5, 5)/40)
  125.             local thing = Instance.new('Part')
  126.             thing.Name = "blood_drop"
  127.             thing.Size = Vector3.new(0.1,0.1,0.1)
  128.             thing.CFrame = frick.CFrame*CFrame.new(0,frick.Size.Y/2,0)
  129.             if splat then
  130.                 thing.Transparency = 0
  131.             elseif not splat then
  132.                 thing.Transparency = 1
  133.             end
  134.             thing.Color = Color3.fromRGB(75, 0, 0)
  135.             thing.Material = Enum.Material.SmoothPlastic
  136.             thing.CanCollide = false
  137.             thing.Velocity = vel
  138.             thing.Parent = junk
  139.             thing:SetNetworkOwner(plr)
  140.             local mesh = Instance.new('SpecialMesh')
  141.             mesh.MeshType = Enum.MeshType.Sphere
  142.             mesh.Parent = thing
  143.             game:GetService("Debris"):AddItem(thing,10)
  144.             local att1,att2 = Instance.new("Attachment"),Instance.new("Attachment")
  145.             att1.Parent = thing
  146.             att1.Position = Vector3.new(0,-(thing.Size.Y/2),0)
  147.             att2.Parent = thing
  148.             att2.Position = Vector3.new(0,(thing.Size.Y/2),0)
  149.             if splat then
  150.                 local trail_drop = Instance.new("Trail")
  151.                 trail_drop.Parent = thing
  152.                 trail_drop.Attachment0 = att1
  153.                 trail_drop.Attachment1 = att2
  154.                 trail_drop.Color = ColorSequence.new(Color3.new(0.5, 0, 0),Color3.new(0.7, 0, 0))
  155.                 trail_drop.FaceCamera = true
  156.                 trail_drop.LightInfluence = 1
  157.                 trail_drop.WidthScale = NumberSequence.new(1,0)
  158.                 trail_drop.Transparency = NumberSequence.new(0,1)
  159.                 trail_drop.Lifetime = 0.1
  160.                 trail_drop.MinLength = 0
  161.             end
  162.             local rawrxd = Instance.new('BodyForce')
  163.             rawrxd.Parent = thing
  164.             rawrxd.Force = vel
  165.             game:GetService("Debris"):AddItem(rawrxd,0.01)
  166.             thing.Touched:connect(function(tou)
  167.                 if tou and tou.Parent and not tou:IsDescendantOf(targchar) and not tou:IsDescendantOf(junk) and not tou.Parent:FindFirstChildOfClass("Humanoid") and not tou.Parent.Parent:FindFirstChildOfClass("Humanoid") and not tou.Parent:IsA("Accessory") and tou.Name ~= 'Handle' and tou.Parent.Name ~= 'Handle' and not tou.Parent:IsA("Tool") and not string.match(tou.Name:lower(),'blood_drop') and not string.match(tou.Name:lower(),'bullet') and not string.match(tou.Name:lower(),'bone') and not string.match(tou.Name:lower(),'gun mag') and not string.match(tou.Name:lower(),'limb') then
  168.                     local pos = Vector3.new(thing.Position.X,(tou.Position.Y+(tou.Size.Y/2))+(0.02/2),thing.Position.Z)
  169.                     local Point1 = pos-Vector3.new(0.01,0.01,0.01)
  170.                     local Point2 = pos+Vector3.new(0.01,0.01,0.01)
  171.                     local Region = Region3.new(Point1,Point2)
  172.                     for _,Part in pairs(game.Workspace:FindPartsInRegion3(Region,nil,math.huge)) do
  173.                         if Part.Name == "blood" then
  174.                             tou = Part
  175.                         end
  176.                     end
  177.                     thing:Destroy()
  178.                     if tou.Name == "blood" then
  179.                         local reee = tou.CFrame
  180.                         if tou.Transparency > -0.2 then
  181.                             tou.Transparency = tou.Transparency - 0.1
  182.                         end
  183.                         local s = 0.025
  184.                         local smax = 0.1
  185.                         if tou.Color.R > 0 then
  186.                             local nc = tou.Color.R*1.012
  187.                             if nc > 1 then
  188.                                 nc = 1
  189.                             end
  190.                             tou.Color = Color3.new(nc, 0, 0)
  191.                         end
  192.                         s = smax*math.clamp(t/10,0,1)
  193.                         if tou.Size.X < 5 then
  194.                             tou.Size = tou.Size+Vector3.new(s*4,0,s*4)
  195.                         elseif tou.Size.X < 7.5 then
  196.                             tou.Size = tou.Size+Vector3.new(s*3,0,s*3)
  197.                         elseif tou.Size.X < 10 then
  198.                             tou.Size = tou.Size+Vector3.new(s*2,0,s*2)
  199.                         end
  200.                         tou.CFrame = reee
  201.                         local tween = game:GetService("TweenService"):Create(tou,TweenInfo.new(4),{Transparency = 1})
  202.                         tween:Play()
  203.                         tween.Completed:Connect(function()
  204.                             if tou.Transparency >= 0.9 then
  205.                                 tou:Destroy()
  206.                             end
  207.                         end)
  208.                         local splash = Instance.new("Sound",tou)
  209.                         splash.SoundId = 'rbxassetid://5157825454' --685857471
  210.                         splash.Volume = 0.025
  211.                         splash.PlayOnRemove = true
  212.                         splash:Destroy()
  213.                     elseif tou.CanCollide == true then
  214.                         local bloodsplat = Instance.new('Part')
  215.                         local s = math.random(5,10)/10
  216.                         if gone_limbs >= 1 then
  217.                             bloodsplat.Size = Vector3.new(s*gone_limbs,0.2,s*gone_limbs)
  218.                         else
  219.                             bloodsplat.Size = Vector3.new(s,0.2,s)
  220.                         end
  221.                         bloodsplat.Name = "blood"
  222.                         bloodsplat.Anchored = true
  223.                         bloodsplat.CanCollide = false
  224.                         bloodsplat.Material = Enum.Material.Glass
  225.                         bloodsplat.Color = Color3.fromRGB(75, 0, 0)
  226.                         bloodsplat.Transparency = -0.2
  227.                         bloodsplat.Parent = junk
  228.                         bloodsplat.CFrame = CFrame.new(pos)
  229.                         local mesh = Instance.new('SpecialMesh')
  230.                         mesh.MeshType = Enum.MeshType.Sphere
  231.                         mesh.Parent = bloodsplat
  232.                         local tween = game:GetService("TweenService"):Create(bloodsplat,TweenInfo.new(4),{Transparency = 1})
  233.                         tween:Play()
  234.                         tween.Completed:Connect(function()
  235.                             if bloodsplat.Transparency >= 0.9 then
  236.                                 bloodsplat:Destroy()
  237.                             end
  238.                         end)
  239.                         local splash = Instance.new("Sound",bloodsplat)
  240.                         splash.SoundId = 'rbxassetid://5157825454'
  241.                         splash.Volume = 0.025
  242.                         splash.PlayOnRemove = true
  243.                         splash:Destroy()
  244.                     end
  245.                 end
  246.             end)
  247.             bleeding[frick] = bleeding[frick] - interval_bleed
  248.             wait(interval_bleed)
  249.         end
  250.     end))
  251. end
  252.  
  253. function blood_splat(obj)
  254.     local ParticleEmitter1 = Instance.new("ParticleEmitter")
  255.     local ParticleEmitter2 = Instance.new("ParticleEmitter")
  256.     local ParticleEmitter3 = Instance.new("ParticleEmitter")
  257.     ParticleEmitter1.Name = "Blood3"
  258.     ParticleEmitter1.Parent = obj
  259.     ParticleEmitter1.Speed = NumberRange.new(3, 7)
  260.     ParticleEmitter1.Rotation = NumberRange.new(-360, 360)
  261.     ParticleEmitter1.Color = ColorSequence.new(Color3.new(0.486275, 0, 0),Color3.new(0.258824, 0, 0))
  262.     ParticleEmitter1.Enabled = false
  263.     ParticleEmitter1.LightEmission = 0.20000000298023
  264.     ParticleEmitter1.LightInfluence = 1
  265.     ParticleEmitter1.Texture = "rbxassetid://241779220"
  266.     ParticleEmitter1.Transparency = NumberSequence.new(1,0.48750001192093,0.75625002384186,1)
  267.     ParticleEmitter1.ZOffset = 0.5
  268.     ParticleEmitter1.Size = NumberSequence.new(0,2.8749995231628)
  269.     ParticleEmitter1.Acceleration = Vector3.new(0, -5, 0)
  270.     ParticleEmitter1.EmissionDirection = Enum.NormalId.Front
  271.     ParticleEmitter1.Lifetime = NumberRange.new(0.40000000596046, 1)
  272.     ParticleEmitter1.Rate = 3000
  273.     ParticleEmitter1.RotSpeed = NumberRange.new(-40, 270)
  274.     ParticleEmitter1.SpreadAngle = Vector2.new(360, 360)
  275.     ParticleEmitter1.VelocitySpread = 360
  276.     ParticleEmitter2.Name = "Blood"
  277.     ParticleEmitter2.Parent = obj
  278.     ParticleEmitter2.Speed = NumberRange.new(5, 10)
  279.     ParticleEmitter2.Rotation = NumberRange.new(-360, 360)
  280.     ParticleEmitter2.Color = ColorSequence.new(Color3.new(0.666667, 0, 0),Color3.new(0.423529, 0, 0))
  281.     ParticleEmitter2.Enabled = false
  282.     ParticleEmitter2.LightEmission = 0.40000000596046
  283.     ParticleEmitter2.LightInfluence = 1
  284.     ParticleEmitter2.Texture = "rbxassetid://73547327"
  285.     ParticleEmitter2.Transparency = NumberSequence.new(0.10000000149012,0.14375001192093,0.49374997615814,1)
  286.     ParticleEmitter2.Size = NumberSequence.new(0,2.8749995231628)
  287.     ParticleEmitter2.Acceleration = Vector3.new(0, -5, 0)
  288.     ParticleEmitter2.EmissionDirection = Enum.NormalId.Front
  289.     ParticleEmitter2.Lifetime = NumberRange.new(0.30000001192093, 0.5)
  290.     ParticleEmitter2.Rate = 10000000
  291.     ParticleEmitter2.RotSpeed = NumberRange.new(-40, 270)
  292.     ParticleEmitter2.SpreadAngle = Vector2.new(360, 360)
  293.     ParticleEmitter2.VelocitySpread = 360
  294.     ParticleEmitter3.Name = "Blood2"
  295.     ParticleEmitter3.Parent = obj
  296.     ParticleEmitter3.Speed = NumberRange.new(5, 14)
  297.     ParticleEmitter3.Color = ColorSequence.new(Color3.new(0.45098, 0, 0),Color3.new(0.45098, 0, 0))
  298.     ParticleEmitter3.Enabled = false
  299.     ParticleEmitter3.LightEmission = 0.20000000298023
  300.     ParticleEmitter3.LightInfluence = 1
  301.     ParticleEmitter3.Texture = "http://www.roblox.com/asset/?id=134531274"
  302.     ParticleEmitter3.Transparency = NumberSequence.new(0.30000001192093,0.30000001192093)
  303.     ParticleEmitter3.ZOffset = 1
  304.     ParticleEmitter3.Size = NumberSequence.new(0.12499988079071,0)
  305.     ParticleEmitter3.Acceleration = Vector3.new(0, -20, 0)
  306.     ParticleEmitter3.EmissionDirection = Enum.NormalId.Front
  307.     ParticleEmitter3.Lifetime = NumberRange.new(0.5, 1.5)
  308.     ParticleEmitter3.Rate = 100000
  309.     ParticleEmitter3.SpreadAngle = Vector2.new(360, 360)
  310.     ParticleEmitter3.VelocitySpread = 360
  311.     --
  312.     ParticleEmitter1:Emit(20)
  313.     ParticleEmitter2:Emit(20)
  314.     ParticleEmitter3:Emit(20)
  315.     --
  316.     game:GetService("Debris"):AddItem(ParticleEmitter1,2)
  317.     game:GetService("Debris"):AddItem(ParticleEmitter2,2)
  318.     game:GetService("Debris"):AddItem(ParticleEmitter3,2)
  319.     --
  320. end
  321.  
  322. function limb_collide(obj,mode,d)
  323.     if (obj:IsA("UnionOperation") or obj:IsA("BasePart")) and not obj:FindFirstChild('limb') then else return end
  324.     local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  325.     if not exists then
  326.         game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  327.     end
  328.     game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  329.     --
  330.     local t = {}
  331.     --
  332.     local cb = Instance.new("Part")
  333.     cb.Name = 'limb'
  334.     cb.Transparency = 1
  335.     cb.CanCollide = true
  336.     cb.Anchored = false
  337.     cb.CFrame = obj.CFrame
  338.     cb.Size = obj.Size*0.9
  339.     cb.Massless = true
  340.     cb.Locked = true
  341.     game:GetService("PhysicsService"):SetPartCollisionGroup(cb,'Limb Collide')
  342.     game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  343.     local weld = Instance.new("Weld")
  344.     weld.Part0 = cb
  345.     weld.Part1 = obj
  346.     weld.Parent = cb
  347.     --obj.Massless = true
  348.     obj.Anchored = false
  349.     if mode or obj:FindFirstChild("Dismembered") then
  350.         cb.Parent = junk -- .Parent
  351.     else
  352.         cb.Parent = junk
  353.         table.insert(t,1,cb)
  354.     end
  355.     if d then
  356.         game:GetService("Debris"):AddItem(cb,d)
  357.     end
  358.     --
  359.     if not string.match(obj.Name:lower(),'torso') and not string.match(obj.Name:lower(),'rootpart') and not string.match(obj.Name:lower(),'head') then
  360.         local lv = Vector3.new() -- Vector3.new(cb.Size.X,0,cb.Size.Z)
  361.         local cb2 = Instance.new("Part")
  362.         cb2.Name = 'limb'
  363.         cb2.Transparency = 1
  364.         cb2.CanCollide = true
  365.         cb2.Anchored = false
  366.         cb2.CFrame = obj.CFrame
  367.         cb2.Size = lv
  368.         cb2.Massless = true
  369.         cb2.Locked = true
  370.         --game:GetService("PhysicsService"):SetPartCollisionGroup(cb2,'Limb Collide')
  371.         local weld2 = Instance.new("Weld")
  372.         weld2.Part0 = cb
  373.         weld2.Part1 = cb2
  374.         weld2.C1 = CFrame.new(0,(cb.Size.Y/2),0)
  375.         weld2.Parent = cb2
  376.         if mode or obj:FindFirstChild("Dismembered") then
  377.             cb2.Parent = junk -- .Parent
  378.         else
  379.             cb2.Parent = junk
  380.             table.insert(t,1,cb2)
  381.         end
  382.         if d then
  383.             game:GetService("Debris"):AddItem(cb2,d)
  384.         end
  385.     end
  386.     --
  387.     return t
  388. end
  389.  
  390. function recurse(root,callback,i)
  391.     i= i or 0
  392.     for _,v in pairs(root:GetChildren()) do
  393.         i = i + 1
  394.         callback(i,v)
  395.  
  396.         if #v:GetChildren() > 0 then
  397.             i = recurse(v,callback,i)
  398.         end
  399.     end
  400.  
  401.     return i
  402. end
  403.  
  404. function ragdollJoint(character, part0, part1, attachmentName, className, properties)
  405.     attachmentName = attachmentName.."RigAttachment"
  406.     local constraint = Instance.new(className.."Constraint")
  407.     constraint.Attachment0 = part0:FindFirstChild(attachmentName)
  408.     constraint.Attachment1 = part1:FindFirstChild(attachmentName)
  409.     constraint.Name = "RagdollConstraint"..part1.Name
  410.  
  411.     for _,propertyData in next,properties or {} do
  412.         constraint[propertyData[1]] = propertyData[2]
  413.     end
  414.  
  415.     constraint.Parent = character
  416. end
  417.  
  418. function getAttachment0(character, attachmentName)
  419.     for _,child in next,character:GetChildren() do
  420.         local attachment = child:FindFirstChild(attachmentName)
  421.         if attachment then
  422.             return attachment
  423.         end
  424.     end
  425. end
  426.  
  427. function ragdoll(targchar,kill,remove)
  428.     if targchar then else return end
  429.     local targplr
  430.     pcall(function()
  431.         targplr = game:GetService("Players"):GetPlayerFromCharacter(targchar)
  432.     end)
  433.     local pc = targchar
  434.     local targhum = pc:FindFirstChildOfClass("Humanoid")
  435.     local js,js2 = {},{}
  436.     local lc = {}
  437.    
  438.     targhum.PlatformStand = true
  439.     --if kill then
  440.         local old_pc
  441.         if remove then
  442.             pc.Archivable = true
  443.             old_pc = pc
  444.             pc = pc:Clone()
  445.         end
  446.         for i,v in pairs(pc:GetDescendants()) do
  447.             if v.Name ~= 'HumanoidRootPart' and v.Name ~= 'Torso' and v:IsA("BasePart") then
  448.                 if remove or not kill then
  449.                     local t = limb_collide(v,false,10)
  450.                     table.insert(lc,1,t)
  451.                 end
  452.             end
  453.             if kill then
  454.                 if v:IsA("ParticleEmitter") then
  455.                     v.Enabled = false
  456.                 end
  457.                 if v:IsA("SelectionBox") or v:IsA("BodyVelocity") or v:IsA("BodyPosition") or v:IsA("BodyAngularVelocity") or v:IsA("BodyForce") or v:IsA("BodyGyro") or v:IsA("BodyThrust") or v:IsA("BodyMover") then
  458.                     if v:IsA("BodyVelocity") then
  459.                         game:GetService("Debris"):AddItem(v,0.15)
  460.                     else
  461.                         v:Destroy()
  462.                     end
  463.                 end
  464.                 if (v:IsA("Script") and v.Name == 'Health') or (v:IsA("LocalScript") and v.Name == 'Animate') then
  465.                     v:Destroy()
  466.                 end
  467.                 if v:IsA("Humanoid") then
  468.                     v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  469.                     v.PlatformStand = true
  470.                 end
  471.             end
  472.         end
  473.         if remove then
  474.             for i,v in pairs(old_pc:GetDescendants()) do
  475.                 if v:IsA("BasePart") or v:IsA("UnionOperation") or v:IsA("ForceField") or v:IsA("Accessory") or v:IsA("Decal") or v:IsA("Texture") or v:IsA("SurfaceGui") then
  476.                     v:destroy()
  477.                 end
  478.                 if v:IsA("Humanoid") then
  479.                     v.BreakJointsOnDeath = true
  480.                     v.Health = 0
  481.                     v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  482.                     v.PlatformStand = true
  483.                 end
  484.             end
  485.             pc.Parent = junk
  486.             game:GetService("Debris"):AddItem(pc,10)
  487.         end
  488.     --end
  489.     --if kill and targhum:FindFirstChild("Ragdolled") then return; end;
  490.     coroutine.resume(coroutine.create(function()
  491.         if targplr then
  492.             for i,v in pairs(pc:GetChildren()) do
  493.                 if v:IsA("BasePart") then
  494.                     --v.Massless = true
  495.                     if v:CanSetNetworkOwnership() then
  496.                         v:SetNetworkOwner(targplr)
  497.                     end
  498.                 end
  499.             end
  500.         end
  501.     end))
  502.     local kb = 15
  503.     local root = pc:FindFirstChild("HumanoidRootPart")
  504.     local targtorso = pc:FindFirstChild("Torso") or pc:FindFirstChild("UpperTorso") or pc:FindFirstChild("Head") or pc:FindFirstChild("HumanoidRootPart")
  505.     if targtorso then else return end
  506.     local dir = targtorso.CFrame.lookVector*-1
  507.     local bv = Instance.new("BodyVelocity")
  508.     bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  509.     bv.Velocity = --[[dir*kb+]]Vector3.new(0,kb,0)
  510.     bv.Parent = targtorso
  511.     game:GetService("Debris"):AddItem(bv,0.1)
  512.     if kill then
  513.         local ragval = Instance.new("ObjectValue")
  514.         ragval.Name = 'Ragdolled'
  515.         ragval.Parent = targhum
  516.     end
  517.     coroutine.resume(coroutine.create(function()
  518.         if (targhum.RigType == Enum.HumanoidRigType.R6 or (targhum.RigType == Enum.HumanoidRigType.R15 and not kill)) then
  519.             for _,m in pairs(pc:GetChildren()) do
  520.                 for _,v in pairs(m:GetChildren()) do
  521.                     if (v:IsA("Snap") --[[or v:IsA('Weld')]] or v:IsA("BallSocketConstraint")) and kill then
  522.                         v:Destroy()
  523.                     end
  524.                     if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA("Weld")) and (v.Parent:IsA("BasePart") or v.Parent:IsA("UnionOperation")) then
  525.                         if not kill then
  526.                             table.insert(js2,1,{obj = v,par = v.Parent})
  527.                         end
  528.  
  529.                         local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
  530.                         a0.CFrame = v.C0
  531.                         a1.CFrame = v.C1
  532.                         a0.Parent = v.Part0
  533.                         a1.Parent = v.Part1
  534.  
  535.                         local b = Instance.new("BallSocketConstraint")
  536.                         b.Attachment0 = a0
  537.                         b.Attachment1 = a1
  538.                         b.Parent = v.Part0
  539.  
  540.                         v.Parent = nil
  541.                         table.insert(js,1,b)
  542.                     end
  543.                 end
  544.             end
  545.         elseif targhum.RigType == Enum.HumanoidRigType.R15 and kill then
  546.             local character = targchar
  547.             recurse(character, function(_,v)
  548.                 if v:IsA("Attachment") then
  549.                     v.Axis = Vector3.new(0, 1, 0)
  550.                     v.SecondaryAxis = Vector3.new(0, 0, 1)
  551.                     v.Rotation = Vector3.new(0, 0, 0)
  552.                 end
  553.             end)
  554.  
  555.             --Re-attach hats
  556.             for _,child in next,character:GetChildren() do
  557.                 if child:IsA("Accoutrement") then
  558.                     --Loop through all parts instead of only checking for one to be forwards-compatible in the event
  559.                     --ROBLOX implements multi-part accessories
  560.                     for _,part in next,child:GetChildren() do
  561.                         if part:IsA("BasePart") then
  562.                             local attachment1 = part:FindFirstChildOfClass("Attachment")
  563.                             local attachment0 = getAttachment0(character, attachment1.Name)
  564.                             if attachment0 and attachment1 then
  565.                                 --Shouldn't use constraints for this, but have to because of a ROBLOX idiosyncrasy where
  566.                                 --joints connecting a character are perpetually deleted while the character is dead
  567.                                 local constraint = Instance.new("HingeConstraint")
  568.                                 constraint.Attachment0 = attachment0
  569.                                 constraint.Attachment1 = attachment1
  570.                                 constraint.LimitsEnabled = true
  571.                                 constraint.UpperAngle = 0 --Simulate weld by making it difficult for constraint to move
  572.                                 constraint.LowerAngle = 0
  573.                                 constraint.Parent = character
  574.                             end
  575.                         end
  576.                     end
  577.                 end
  578.             end
  579.  
  580.             ragdollJoint(character, character.LowerTorso, character.UpperTorso, "Waist", "BallSocket", {
  581.                 {"LimitsEnabled",true};
  582.                 {"UpperAngle",5};
  583.             })
  584.             ragdollJoint(character, character.UpperTorso, character.Head, "Neck", "BallSocket", {
  585.                 {"LimitsEnabled",true};
  586.                 {"UpperAngle",15};
  587.             })
  588.  
  589.             local handProperties = {
  590.                 {"LimitsEnabled", true};
  591.                 {"UpperAngle",0};
  592.                 {"LowerAngle",0};
  593.             }
  594.             ragdollJoint(character, character.LeftLowerArm, character.LeftHand, "LeftWrist", "Hinge", handProperties)
  595.             ragdollJoint(character, character.RightLowerArm, character.RightHand, "RightWrist", "Hinge", handProperties)
  596.  
  597.             local shinProperties = {
  598.                 {"LimitsEnabled", true};
  599.                 {"UpperAngle", 0};
  600.                 {"LowerAngle", -75};
  601.             }
  602.             ragdollJoint(character, character.LeftUpperLeg, character.LeftLowerLeg, "LeftKnee", "Hinge", shinProperties)
  603.             ragdollJoint(character, character.RightUpperLeg, character.RightLowerLeg, "RightKnee", "Hinge", shinProperties)
  604.  
  605.             local footProperties = {
  606.                 {"LimitsEnabled", true};
  607.                 {"UpperAngle", 15};
  608.                 {"LowerAngle", -45};
  609.             }
  610.             ragdollJoint(character, character.LeftLowerLeg, character.LeftFoot, "LeftAnkle", "Hinge", footProperties)
  611.             ragdollJoint(character, character.RightLowerLeg, character.RightFoot, "RightAnkle", "Hinge", footProperties)
  612.  
  613.             --TODO fix ability for socket to turn backwards whenn ConeConstraints are shipped
  614.             ragdollJoint(character, character.UpperTorso, character.LeftUpperArm, "LeftShoulder", "BallSocket")
  615.             ragdollJoint(character, character.LeftUpperArm, character.LeftLowerArm, "LeftElbow", "BallSocket")
  616.             ragdollJoint(character, character.UpperTorso, character.RightUpperArm, "RightShoulder", "BallSocket")
  617.             ragdollJoint(character, character.RightUpperArm, character.RightLowerArm, "RightElbow", "BallSocket")
  618.             ragdollJoint(character, character.LowerTorso, character.LeftUpperLeg, "LeftHip", "BallSocket")
  619.             ragdollJoint(character, character.LowerTorso, character.RightUpperLeg, "RightHip", "BallSocket")
  620.         end
  621.     end))
  622.     if root then
  623.         root.CanCollide = false
  624.     end
  625.     local c
  626.     if root then
  627.         c = root.Touched:Connect(function(obj)
  628.             if obj and not obj:IsDescendantOf(junk) and (root.Velocity.Magnitude >= 3) then
  629.                 local impact = Instance.new("Sound",root)
  630.                 impact.Name = 'impact'
  631.                 impact.SoundId = 'rbxassetid://' .. impacts[math.random(1,#impacts)]
  632.                 impact.Volume = 0.1
  633.                 impact.PlayOnRemove = true
  634.                 impact:Destroy()
  635.             end
  636.         end)
  637.     end
  638.     local function restore()
  639.         if c then
  640.             c:Disconnect()
  641.         end
  642.         if root then
  643.             root.CFrame = root.CFrame*CFrame.new(0,4,0)
  644.         end
  645.         for i,v in pairs(js) do
  646.             v:Destroy()
  647.         end
  648.         for i,v in pairs(lc) do
  649.             for i,v in pairs(v) do
  650.                 v:Destroy()
  651.             end
  652.         end
  653.         if targhum then
  654.             targhum.PlatformStand = false
  655.         end
  656.         for i,v in pairs(js2) do
  657.             v.obj.Parent = v.par
  658.         end
  659.         if root then
  660.             root.CanCollide = true
  661.         end
  662.     end
  663.     return restore
  664. end
  665.  
  666. function connectfall(plr,torso,hum)
  667.     local dmg = 0
  668.     local saved_vel = 0
  669.     while falling[hum] do
  670.         if not falling[hum] then
  671.             break
  672.         end
  673.         saved_vel = torso.Velocity.Magnitude
  674.         wait(0)
  675.     end
  676.     if saved_vel >= 75 then
  677.         dmg = 100*(saved_vel/fatal_vel)
  678.         if saved_vel >= fatal_vel*1.2 and torso and plr.Character then
  679.             local p = Instance.new("Part")
  680.             p.CanCollide = false
  681.             p.Anchored = true
  682.             p.Size = Vector3.new()
  683.             p.Position = torso.Position
  684.             p.Transparency = 1
  685.             p.Parent = junk
  686.             local impact = Instance.new("Sound",p)
  687.             impact.Name = 'impact'
  688.             impact.SoundId = 'rbxassetid://' .. impacts[math.random(1,#impacts)]
  689.             impact.Volume = 0.1
  690.             impact.PlayOnRemove = true
  691.             impact:Destroy()
  692.             local explode2 = Instance.new("Sound",p)
  693.             explode2.Name = 'expode'
  694.             explode2.SoundId = 'rbxassetid://' .. impacts[math.random(1,#impacts)]
  695.             explode2.Volume = 0.15
  696.             explode2.PlayOnRemove = true
  697.             explode2:Destroy()
  698.             local exp_gore = Instance.new("Sound")
  699.             exp_gore.SoundId = "rbxassetid://" .. gores3[math.random(1,#gores3)]
  700.             exp_gore.Volume = 4
  701.             exp_gore.Parent = p
  702.             exp_gore:Play()
  703.             local pe = Instance.new("ParticleEmitter")
  704.             pe.Speed = NumberRange.new(15, 15)
  705.             pe.Color = ColorSequence.new({
  706.                 ColorSequenceKeypoint.new(0,Color3.new(1, 0, 0)),
  707.                 ColorSequenceKeypoint.new(0.5,Color3.new(1, 0.33333, 0)),
  708.                 ColorSequenceKeypoint.new(1,Color3.new(1, 1, 1)),
  709.             })
  710.             pe.LightEmission = 0.80000001192093
  711.             pe.Texture = "rbxassetid://162359401"
  712.             pe.Size = NumberSequence.new({
  713.                 NumberSequenceKeypoint.new(0,0),
  714.                 NumberSequenceKeypoint.new(0.0264,1),
  715.                 NumberSequenceKeypoint.new(0.3,1),
  716.                 NumberSequenceKeypoint.new(0.5,1.5),
  717.                 NumberSequenceKeypoint.new(1,2),
  718.             })
  719.             --pe.Drag = 0.60000002384186
  720.             pe.Transparency = NumberSequence.new({
  721.                 NumberSequenceKeypoint.new(0,0),
  722.                 NumberSequenceKeypoint.new(0.5,0),
  723.                 NumberSequenceKeypoint.new(1,1),
  724.             })
  725.             pe.Lifetime = NumberRange.new(1,2)
  726.             pe.Rate = 100
  727.             pe.SpreadAngle = Vector2.new(180, 180)
  728.             pe.Parent = p
  729.             pe.Enabled = false
  730.             pe:Emit(75)
  731.             blood_splat(p)
  732.             for _,v in pairs(plr.Character:GetChildren()) do
  733.                 if v:IsA("BasePart") or v:IsA("UnionOperation") then
  734.                     explode_limb(plr,v,plr.Character,v.CFrame.upVector*-1,dmg)
  735.                 end
  736.             end
  737.             game:GetService("Debris"):AddItem(p,5)
  738.         end
  739.         if check_godded(hum) then
  740.             return
  741.         end
  742.         if not check_fatal(hum,dmg) then
  743.             if not torso:FindFirstChild("pain groan") then
  744.                 local groan = Instance.new("Sound")
  745.                 groan.Name = 'pain groan'
  746.                 groan.SoundId = 'rbxassetid://' .. stuns[math.random(1,#stuns)]
  747.                 groan.Volume = 1
  748.                 groan.Parent = torso
  749.                 groan.PlayOnRemove = true
  750.                 groan:Destroy()
  751.             end
  752.             coroutine.resume(coroutine.create(function()
  753.                 ragdolled[plr] = true
  754.                 local restore = ragdoll(torso.Parent,false)
  755.                 hum:SetStateEnabled(Enum.HumanoidStateType.Freefall,true)
  756.                 hum:SetStateEnabled(Enum.HumanoidStateType.Landed,true)
  757.                 wait(10*(saved_vel/fatal_vel))
  758.                 if plr and ragdolled[plr] then
  759.                     ragdolled[plr] = false
  760.                 end
  761.                 if restore then
  762.                     restore()
  763.                 end
  764.             end))
  765.         end
  766.         blood_splat(torso,torso.Position,Vector3.new())
  767.         --[[
  768.         if check_fatal(hum,dmg) then
  769.             bleed2(plr,torso,hum,false,game:GetService("Players").RespawnTime,false,torso.CFrame.upVector*-1)
  770.         elseif dmg >= 25 then
  771.             bleed2(plr,torso,hum,false,3,false,torso.CFrame.upVector*-1)
  772.         end
  773.         ]]
  774.         local smash_s = Instance.new("Sound")
  775.         smash_s.Parent = torso
  776.         smash_s.PlayOnRemove = true
  777.         local dmg_s = Instance.new("Sound")
  778.         dmg_s.Parent = torso
  779.         dmg_s.PlayOnRemove = true
  780.         if check_fatal(hum,dmg) then
  781.             --smash_s.SoundId = 'rbxassetid://' .. gores2[math.random(1,#gores2)]
  782.             smash_s.Volume = 0.7
  783.             dmg_s.SoundId = 'rbxassetid://704141469'
  784.             dmg_s.Volume = 1.5
  785.         elseif dmg >= 50 then
  786.             --smash_s.SoundId = 'rbxassetid://' .. gores1[math.random(1,#gores1)]
  787.             smash_s.Volume = 0.7
  788.             dmg_s.SoundId = 'rbxassetid://535681058'
  789.             dmg_s.Volume = 1
  790.         elseif dmg >= 25 then
  791.             dmg_s.SoundId = 'rbxassetid://4057626616'
  792.             dmg_s.Volume = 1.5
  793.         end
  794.         smash_s:Destroy()
  795.         dmg_s:Destroy()
  796.         hum:TakeDamage(dmg)
  797.     end
  798. end
  799.  
  800. function burn_up(obj,mode)
  801.     if mode == 1 then
  802.         local particle = obj:FindFirstChild("flame")
  803.         local light = obj:FindFirstChild("flame light")
  804.         local flame_sound = obj:FindFirstChild('burn up')
  805.         local scream_sound = obj:FindFirstChild('flame scream')
  806.         if not obj:FindFirstChild("burn up") then
  807.             local start_flame = Instance.new("Sound")
  808.             start_flame.SoundId = 'rbxassetid://5868574236'
  809.             start_flame.Parent = obj
  810.             start_flame.Volume = 2.5
  811.             start_flame.PlayOnRemove = true
  812.             start_flame:Destroy()
  813.             flame_sound = Instance.new("Sound")
  814.             flame_sound.Name = 'burn up'
  815.             flame_sound.SoundId = 'rbxassetid://443980606'
  816.             flame_sound.Volume = 1.5
  817.             flame_sound.Parent = obj
  818.             flame_sound.Looped = true
  819.             flame_sound:Play()
  820.             scream_sound = Instance.new("Sound")
  821.             scream_sound.Name = 'flame scream'
  822.             scream_sound.SoundId = 'rbxassetid://147758618'
  823.             scream_sound.Parent = obj
  824.             scream_sound.Looped = true
  825.             scream_sound:Play()
  826.             local PointLight1 = Instance.new("PointLight")
  827.             PointLight1.Name = 'flame light'
  828.             PointLight1.Parent = obj
  829.             PointLight1.Color = Color3.new(1, 0.803922, 0.341176)
  830.             PointLight1.Range = 21
  831.             PointLight1.Brightness = 0.47499999403954
  832.             PointLight1.Shadows = true
  833.             light = PointLight1
  834.             particle = Instance.new("Fire")
  835.             particle.Name = 'flame'
  836.             particle.Size = 10
  837.             particle.Parent = obj
  838.         end
  839.     elseif mode == 2 then
  840.         local particle = obj:FindFirstChild("flame")
  841.         local light = obj:FindFirstChild("flame light")
  842.         local flame_sound = obj:FindFirstChild('burn up')
  843.         local scream_sound = obj:FindFirstChild('flame scream')
  844.         if particle and particle.Enabled then
  845.             particle.Enabled = false
  846.             game:GetService("Debris"):AddItem(particle,1.5)
  847.         end
  848.         if light and light.Enabled then
  849.             light.Enabled = false
  850.             game:GetService("Debris"):AddItem(light,1)
  851.         end
  852.         if flame_sound then
  853.             flame_sound:Destroy()
  854.         end
  855.         if scream_sound then
  856.             scream_sound:Destroy()
  857.         end
  858.     end
  859. end
  860.  
  861. function explode_limb(plr,obj,targchar,dir,dmg)
  862.     local targhum = targchar:FindFirstChildOfClass("Humanoid")
  863.     local targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("HumanoidRootPart")
  864.     if dmg > 0 and not obj:FindFirstChild('Dismembered') --[[and obj.Name ~= 'Torso' and obj.Name ~= 'HumanoidRootPart' and obj.Name ~= 'UpperTorso' and obj.Name ~= 'LowerTorso']] then else return end
  865.     local d = 10
  866.     local t = dmg/d
  867.     local t2 = dmg/20/d
  868.     bleed2(plr,targtorso,targhum,true,t,true,Vector3.new(0,-1,0).Unit)
  869.     local gs = Instance.new("Sound")
  870.     gs.SoundId = 'rbxassetid://206082273' -- 'rbxassetid://' .. gores2[math.random(1,#gores2)]
  871.     gs.Volume = 0.3
  872.     gs.PlayOnRemove = true
  873.     gs.Parent = obj
  874.     gs:Destroy()
  875.     for i = 1,d do
  876.         local p = Vector3.new(obj.Size.X/math.random(d/3,d/2),obj.Size.Y/math.random(d/3,d/2),obj.Size.Z/math.random(d/3,d/2))
  877.         local blood_chunk = Instance.new("Part")
  878.         blood_chunk.Size = p
  879.         blood_chunk.CanCollide = true
  880.         blood_chunk.Anchored = false
  881.         if math.random(1,2) == 1 then
  882.             blood_chunk.Color = Color3.fromRGB(math.random(90,170),0,0)
  883.         else
  884.             blood_chunk.Color = obj.Color
  885.         end
  886.         blood_chunk.Position = obj.Position+Vector3.new(math.random(-obj.Size.X*10,obj.Size.X*10)/10/2,math.random(-obj.Size.Y*10,obj.Size.Y*10)/10/2,math.random(-obj.Size.Z*10,obj.Size.Z*10)/10/2)
  887.         blood_chunk.Material = Enum.Material.Slate
  888.         blood_chunk.Parent = junk
  889.         local kb = 25
  890.         local ka = 90
  891.         local bav = Instance.new("BodyAngularVelocity")
  892.         bav.MaxTorque = Vector3.new(math.huge,math.huge,math.huge)
  893.         bav.AngularVelocity = Vector3.new(math.random(-ka,ka),math.random(-ka,ka),math.random(-ka,ka))
  894.         bav.Parent = blood_chunk
  895.         local bv = Instance.new("BodyVelocity")
  896.         bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  897.         local ud = (obj.Position-blood_chunk.Position).Unit
  898.         if kb*3 >= ud.Magnitude then
  899.             bv.Velocity = (ud*kb)+Vector3.new(0,kb,0)
  900.             --bleed2(plr,targtorso,targhum,true,3,false,ud)
  901.         else
  902.             bv.Velocity = Vector3.new(0,kb,0)
  903.             --bleed2(plr,targtorso,targhum,true,3,false,dir)
  904.         end
  905.         bv.Parent = blood_chunk
  906.         game:GetService("Debris"):AddItem(bv,0.1)
  907.         game:GetService("Debris"):AddItem(bav,0.1)
  908.         game:GetService("Debris"):AddItem(blood_chunk,10)
  909.     end
  910.     obj:Destroy()
  911. end
  912.  
  913. function bind(plr,char,new)
  914.     pcall(function()
  915.         if char then else return end
  916.         if is_enabled(plr) then
  917.             local ff = Instance.new("ForceField",char)
  918.             game:GetService("Debris"):AddItem(ff,1)
  919.         end
  920.         local torso = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso") or char:FindFirstChild("HumanoidRootPart")
  921.         local hum = char:FindFirstChildOfClass("Humanoid")
  922.         local base = workspace:FindFirstChild('Base') or workspace:FindFirstChild('Baseplate')
  923.         if new then
  924.             wait(0.1)
  925.             if base then
  926.                 torso.CFrame = base.CFrame*CFrame.new(0,4,0)
  927.             else
  928.                 torso.CFrame = CFrame.new(0,4,0)
  929.             end
  930.         end
  931.         hum.StateChanged:Connect(function(oldstate,newstate)
  932.             local foundstate = false
  933.             for i,v in pairs(fallstates) do
  934.                 if v == newstate then
  935.                     foundstate = true
  936.                     break
  937.                 end
  938.             end
  939.             if foundstate and not check_godded(hum) and is_enabled(plr) then
  940.                 if not falling[hum] then
  941.                     falling[hum] = true
  942.                     connectfall(plr,torso,hum)
  943.                 end
  944.             else
  945.                 falling[hum] = false
  946.             end
  947.         end)
  948.         local cv
  949.         if is_enabled(plr) then
  950.             cv = game:GetService("RunService").Stepped:Connect(function()
  951.                 if not char or not char.Parent or not torso or not torso.Parent or not hum then
  952.                     cv:Disconnect()
  953.                 end
  954.                 local vel = torso.Velocity.Magnitude
  955.                 if vel >= terminal_vel and not check_godded(hum) then
  956.                     local dmg = (vel/terminal_vel)/5
  957.                     hum:TakeDamage(dmg)
  958.                     burn_up(torso,1)
  959.                 else
  960.                     burn_up(torso,2)
  961.                 end
  962.             end)
  963.         end
  964.         if hum.RigType == Enum.HumanoidRigType.R6 then
  965.             hum.BreakJointsOnDeath = false
  966.             hum:SetStateEnabled(Enum.HumanoidStateType.Dead,true)
  967.         end
  968.         local bid = 0
  969.         local did_break = {}
  970.         local can_break = false
  971.         local dmged = false
  972.        
  973.         for _,limb in pairs(char:GetChildren()) do
  974.             if (limb:IsA("BasePart") or limb:IsA("UnionOperation")) and limb.Name ~= 'HumanoidRootPart' and limb.Name ~= 'Torso' and limb.Name ~= 'UpperTorso' and limb.Name ~= 'LowerTorso' then
  975.                 limb.Touched:Connect(function(obj)
  976.                     local saved_vel = limb.Velocity.Magnitude
  977.                     local saved_vel2 = obj.Velocity.Magnitude*(obj.Mass/5)
  978.                     local dmg = (saved_vel/fatal_vel)*hum.MaxHealth
  979.                     local dmg2 = (saved_vel2/fatal_vel)*hum.MaxHealth
  980.                     if obj and obj.Parent and not obj.Parent:FindFirstChildOfClass("Humanoid") and obj.CanCollide then else
  981.                         saved_vel2 = 0
  982.                     end
  983.                     if limb and not dmged and (can_break or ragdolled[plr]) and not check_godded(hum) and (saved_vel >= fatal_vel or saved_vel2 >= fatal_vel) then
  984.                         dmged = true
  985.                         did_break[bid] = true
  986.                         local p = Instance.new("Part")
  987.                         p.CanCollide = false
  988.                         p.Anchored = true
  989.                         p.Size = Vector3.new()
  990.                         p.Position = limb.Position
  991.                         p.Transparency = 1
  992.                         p.Parent = junk
  993.                         local impact = Instance.new("Sound",p)
  994.                         impact.Name = 'impact'
  995.                         impact.SoundId = 'rbxassetid://' .. impacts[math.random(1,#impacts)]
  996.                         impact.Volume = 0.1
  997.                         impact.PlayOnRemove = true
  998.                         impact:Destroy()
  999.                         local explode2 = Instance.new("Sound",p)
  1000.                         explode2.Name = 'expode'
  1001.                         explode2.SoundId = 'rbxassetid://' .. impacts[math.random(1,#impacts)]
  1002.                         explode2.Volume = 0.15
  1003.                         explode2.PlayOnRemove = true
  1004.                         explode2:Destroy()
  1005.                         local exp_gore = Instance.new("Sound")
  1006.                         exp_gore.SoundId = "rbxassetid://" .. gores3[math.random(1,#gores3)]
  1007.                         exp_gore.Volume = 4
  1008.                         exp_gore.Parent = p
  1009.                         exp_gore:Play()
  1010.                         local pe = Instance.new("ParticleEmitter")
  1011.             pe.Speed = NumberRange.new(15, 15)
  1012.             pe.Color = ColorSequence.new({
  1013.                 ColorSequenceKeypoint.new(0,Color3.new(1, 0, 0)),
  1014.                 ColorSequenceKeypoint.new(0.5,Color3.new(1, 0.33333, 0)),
  1015.                 ColorSequenceKeypoint.new(1,Color3.new(1, 1, 1)),
  1016.             })
  1017.             pe.LightEmission = 0.80000001192093
  1018.             pe.Texture = "rbxassetid://162359401"
  1019.             pe.Size = NumberSequence.new({
  1020.                 NumberSequenceKeypoint.new(0,0),
  1021.                 NumberSequenceKeypoint.new(0.0264,1),
  1022.                 NumberSequenceKeypoint.new(0.3,1),
  1023.                 NumberSequenceKeypoint.new(0.5,1.5),
  1024.                 NumberSequenceKeypoint.new(1,2),
  1025.             })
  1026.             --pe.Drag = 0.60000002384186
  1027.             pe.Transparency = NumberSequence.new({
  1028.                 NumberSequenceKeypoint.new(0,0),
  1029.                 NumberSequenceKeypoint.new(0.5,0),
  1030.                 NumberSequenceKeypoint.new(1,1),
  1031.             })
  1032.             pe.Lifetime = NumberRange.new(1,2)
  1033.             pe.Rate = 100
  1034.             pe.SpreadAngle = Vector2.new(180, 180)
  1035.             pe.Parent = p
  1036.             pe.Enabled = false
  1037.             pe:Emit(75)
  1038.                         blood_splat(p)
  1039.                         for _,v in pairs(char:GetChildren()) do
  1040.                             if v:IsA("BasePart") or v:IsA("UnionOperation") then
  1041.                                 explode_limb(plr,v,char,v.CFrame.upVector*-1,dmg)
  1042.                             end
  1043.                         end
  1044.                         game:GetService("Debris"):AddItem(p,5)
  1045.                         wait(0.2)
  1046.                         dmged = false
  1047.  
  1048.                     elseif limb and not dmged and (can_break or ragdolled[plr]) and (dmg >= 40 or dmg2 >= 40) then
  1049.                         dmged = true
  1050.                         did_break[bid] = true
  1051.                         local d = dmg
  1052.                         if dmg2 > dmg then
  1053.                             d = dmg2
  1054.                         end
  1055.                         local p = Instance.new("Part")
  1056.                         p.CanCollide = false
  1057.                         p.Anchored = true
  1058.                         p.Size = Vector3.new()
  1059.                         p.Position = limb.Position
  1060.                         p.Transparency = 1
  1061.                         p.Parent = junk
  1062.                         local impact = Instance.new("Sound",p)
  1063.                         impact.Name = 'impact'
  1064.                         impact.SoundId = 'rbxassetid://' .. impacts[math.random(1,#impacts)]
  1065.                         impact.Volume = 0.1
  1066.                         impact.PlayOnRemove = true
  1067.                         impact:Destroy()
  1068.                         local explode = Instance.new("Sound",p)
  1069.                         explode.Name = 'expode'
  1070.                         explode.SoundId = 'rbxassetid://' .. gores2[math.random(1,#gores2)]
  1071.                         explode.Volume = 0.1
  1072.                         explode.PlayOnRemove = true
  1073.                         explode:Destroy()
  1074.                         blood_splat(p)
  1075.                         explode_limb(plr,limb,char,limb.CFrame.upVector*-1,d)
  1076.                         game:GetService("Debris"):AddItem(p,2)
  1077.                         wait(0.2)
  1078.                         dmged = false
  1079.  
  1080.                     end
  1081.                 end)
  1082.             end
  1083.         end
  1084.         local curhealth = hum.Health
  1085.         hum.HealthChanged:Connect(function(newhealth)
  1086.             if check_godded(hum) then return end
  1087.             local dmg = (curhealth-newhealth)
  1088.             if curhealth > newhealth and torso --[[and hum.Health > 0]] then
  1089.                 if dmg >= 30 or 0 >= newhealth then
  1090.                     bid = bid + 1
  1091.                     can_break = true
  1092.                     wait(0.4)
  1093.                     can_break = false
  1094.                 end
  1095.                 if dmg > 0 then
  1096.                     if not did_break[bid] then
  1097.                         bleed2(plr,torso,hum,false,(dmg/hum.MaxHealth)*10,false,torso.CFrame.upVector*-1)
  1098.                     end
  1099.                 end
  1100.             end
  1101.             curhealth = hum.Health
  1102.         end)
  1103.         hum.Died:Connect(function()
  1104.             ragdoll(char,true)
  1105.         end)
  1106.     end)
  1107. end
  1108.  
  1109. function chat(plr)
  1110.     plr.Chatted:Connect(function(msg)
  1111.         if msg:lower():sub(1,6) == 'tfall/' then
  1112.             local bool = msg:lower():sub(7)
  1113.             if bool == 'true' then
  1114.                 toggle_enable(plr,true)
  1115.             elseif bool == 'false' then
  1116.                 toggle_enable(plr,false)
  1117.             end
  1118.         end
  1119.     end)
  1120. end
  1121.  
  1122. for _,plr in pairs(game:GetService("Players"):GetPlayers()) do
  1123.     chat(plr)
  1124.     bind(plr,plr.Character)
  1125.     plr.CharacterAdded:Connect(function(char)
  1126.         bind(plr,char,true)
  1127.     end)
  1128. end
  1129.  
  1130. game:GetService("Players").PlayerAdded:Connect(function(plr)
  1131.     chat(plr)
  1132.     plr.CharacterAdded:Connect(function(char)
  1133.         bind(plr,char,true)
  1134.     end)
  1135. end)
  1136.  
  1137. while wait(1) do
  1138.     if not junk then
  1139.         junk = Instance.new("Folder",script)
  1140.     end
  1141. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement