KrYn0MoRe

mp40

Sep 13th, 2020 (edited)
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 69.08 KB | None | 0 0
  1. local plr = owner
  2. local char = plr.Character
  3. local hum = char:FindFirstChildOfClass("Humanoid")
  4. local torso = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
  5. local rootpart = char:FindFirstChild("HumanoidRootPart")
  6.  
  7. local debris = game:GetService("Debris")
  8. local tween = game:GetService("TweenService")
  9.  
  10. local gun = Instance.new("Tool")
  11. local han = Instance.new("Part")
  12. local SpecialMesh2 = Instance.new("SpecialMesh")
  13. gun.Name = "MP40"
  14. gun.Parent = plr['Backpack']
  15. gun.Grip = CFrame.new(0.660811424, -0.0547437184, -0.0302125812, -9.93472327e-08, -0.00441347063, 0.999990404, -1.92918556e-10, 0.999990284, 0.00441347761, -1, 2.45549053e-10, -9.93471261e-08)
  16. han.Name = "Handle"
  17. han.Parent = gun
  18. han.CFrame = CFrame.new(-12.8730011, 1.41801429, 2.45399928, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  19. han.Position = Vector3.new(-12.8730011, 1.41801429, 2.45399928)
  20. han.Color = Color3.fromRGB(99, 95, 98)
  21. han.Size = Vector3.new(4.53800011, 1.88800001, 0.280000001)
  22. han.BottomSurface = Enum.SurfaceType.Smooth
  23. han.BrickColor = BrickColor.new("Reddish brown")
  24. han.TopSurface = Enum.SurfaceType.Smooth
  25. han.brickColor = BrickColor.new("Reddish brown")
  26. SpecialMesh2.Parent = han
  27. SpecialMesh2.MeshId = "rbxassetid://430331375"
  28. SpecialMesh2.Scale = Vector3.new(0.00485000014, 0.00485000014, 0.00485000014)
  29. SpecialMesh2.TextureId = "rbxassetid://430330399"
  30. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  31.  
  32. local effect_part = Instance.new("Part")
  33. local smoke = Instance.new("ParticleEmitter")
  34. local flash = Instance.new("ParticleEmitter")
  35. local light = Instance.new("PointLight")
  36. effect_part.Name = "effect"
  37. effect_part.Parent = gun
  38. effect_part.CFrame = CFrame.new(-14.3099976, 2.64201403, -6.57999992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  39. effect_part.Position = Vector3.new(-14.3099976, 2.64201403, -6.57999992)
  40. effect_part.Transparency = 1
  41. effect_part.Size = Vector3.new(0.100000001, 0.100000001, 0.100000001)
  42. effect_part.BottomSurface = Enum.SurfaceType.Smooth
  43. effect_part.CanCollide = false
  44. effect_part.TopSurface = Enum.SurfaceType.Smooth
  45. smoke.Name = "smoke"
  46. smoke.Parent = effect_part
  47. smoke.Speed = NumberRange.new(5, 7)
  48. smoke.Rotation = NumberRange.new(0, 360)
  49. smoke.Color = ColorSequence.new(Color3.new(0.27451, 0.27451, 0.27451),Color3.new(0.27451, 0.27451, 0.27451))
  50. smoke.Enabled = false
  51. smoke.LightEmission = 0.10000000149012
  52. smoke.Texture = "http://www.roblox.com/asset/?id=244514423"
  53. smoke.Transparency = NumberSequence.new(0.60000002384186,1)
  54. smoke.Size = NumberSequence.new(0.99999964237213,3)
  55. smoke.Lifetime = NumberRange.new(1.25, 1.5)
  56. smoke.Rate = 100
  57. smoke.RotSpeed = NumberRange.new(10, 10)
  58. smoke.SpreadAngle = Vector2.new(15, 15)
  59. smoke.VelocitySpread = 15
  60. flash.Name = "flash"
  61. flash.Parent = effect_part
  62. flash.Speed = NumberRange.new(0, 0)
  63. flash.Rotation = NumberRange.new(0, 90)
  64. flash.Color = ColorSequence.new(Color3.new(1, 1, 0.498039),Color3.new(1, 1, 0.498039))
  65. flash.Enabled = false
  66. flash.LightEmission = 1
  67. flash.Texture = "http://www.roblox.com/asset/?id=3419963"
  68. flash.Transparency = NumberSequence.new(0.75,1)
  69. flash.Size = NumberSequence.new(0.20000000298023,0.20000000298023)
  70. flash.Lifetime = NumberRange.new(0.050000000745058, 0.075000002980232)
  71. flash.Rate = 1000
  72. light.Name = "light"
  73. light.Parent = effect_part
  74. light.Color = Color3.new(1, 1, 0.498039)
  75. light.Enabled = false
  76. light.Range = 6
  77. light.Brightness = 10
  78. light.Shadows = true
  79.  
  80. local weld = Instance.new("Weld")
  81. weld.Part0 = han
  82. weld.Part1 = effect_part
  83. weld.C1 = weld.C1 * CFrame.new((han.Size.X/2),-0.5,0)
  84. weld.Parent = effect_part
  85.  
  86. local cols = {BrickColor.new("Neon orange"),BrickColor.new("Really red"),BrickColor.new("Bright red"),BrickColor.new("Br. yellowish orange"),BrickColor.new("Bright yellow")}
  87. local taunts = {298689061,2743459732,2852509470,1018518369}
  88. local using = false
  89. local op = false
  90. local bulletfire = 1
  91. local shootwait = 0.04*bulletfire
  92. local max_ammo = 32
  93. local ammo = max_ammo
  94. local hitpos = nil
  95. local shooting = false
  96. local equipped = false
  97.  
  98. local equip = Instance.new("Sound")
  99. equip.SoundId = 'rbxassetid://3667098999'
  100. equip.Volume = 0.8
  101. equip.Parent = han
  102.  
  103. local shoot_s = Instance.new("Sound")
  104. shoot_s.Name = 'shoot'
  105. shoot_s.SoundId = 'rbxassetid://132456050'
  106. shoot_s.Volume = 3
  107. shoot_s.Parent = han
  108.  
  109. local reload_s = Instance.new("Sound")
  110. reload_s.SoundId = 'rbxassetid://132456068'
  111. reload_s.Volume = 0.7
  112. reload_s.Parent = han
  113.  
  114. local wbreak = Instance.new("Sound")
  115. wbreak.Parent = han
  116. wbreak.SoundId = "rbxassetid://627558611"
  117. wbreak.TimePosition = .1
  118. wbreak.Volume = 0.7
  119.  
  120. function CheckIfAlive()
  121.     local alive = false
  122.     if plr and char and char.Parent and torso and torso.Parent and hum and hum.Parent and hum.Health > 0 then
  123.         alive = true
  124.     end
  125.     return alive
  126. end
  127. function limb_collide(obj,mode)
  128.     if (obj:IsA("UnionOperation") or obj:IsA("BasePart")) and not obj:FindFirstChild('limb') then else return end
  129.     local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  130.     if not exists then
  131.         game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  132.     end
  133.     game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  134.     --
  135.     local t = {}
  136.     --
  137.     local cb = Instance.new("Part")
  138.     cb.Name = 'limb'
  139.     cb.Transparency = 1
  140.     cb.CanCollide = true
  141.     cb.Anchored = false
  142.     cb.CFrame = obj.CFrame
  143.     cb.Size = obj.Size
  144.     cb.Massless = true
  145.     cb.Locked = true
  146.     game:GetService("PhysicsService"):SetPartCollisionGroup(cb,'Limb Collide')
  147.     game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  148.     local weld = Instance.new("Weld")
  149.     weld.Part0 = cb
  150.     weld.Part1 = obj
  151.     weld.Parent = cb
  152.     obj.Massless = true
  153.     obj.Anchored = false
  154.     if mode or obj:FindFirstChild("Dismembered") then
  155.         cb.Parent = obj -- .Parent
  156.     else
  157.         cb.Parent = script
  158.         table.insert(t,1,cb)
  159.     end
  160.     --
  161.     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
  162.         local lv = Vector3.new() -- Vector3.new(cb.Size.X,0,cb.Size.Z)
  163.         local cb2 = Instance.new("Part")
  164.         cb2.Name = 'limb'
  165.         cb2.Transparency = 1
  166.         cb2.CanCollide = true
  167.         cb2.Anchored = false
  168.         cb2.CFrame = obj.CFrame
  169.         cb2.Size = lv
  170.         cb2.Massless = true
  171.         cb2.Locked = true
  172.         local weld2 = Instance.new("Weld")
  173.         weld2.Part0 = cb
  174.         weld2.Part1 = cb2
  175.         weld2.C1 = CFrame.new(0,(cb.Size.Y/2),0)
  176.         weld2.Parent = cb2
  177.         if mode or obj:FindFirstChild("Dismembered") then
  178.             cb2.Parent = obj -- .Parent
  179.         else
  180.             cb2.Parent = script
  181.             table.insert(t,1,cb2)
  182.         end
  183.     end
  184.     --
  185.     return t
  186. end
  187. function Ragdoll(targchar,headless,insta,kill)
  188.     local pc = targchar
  189.     local targhum = pc:FindFirstChild("Humanoid")
  190.     local js,js2 = {},{}
  191.     for _,obj in pairs(pc:GetDescendants()) do
  192.         if obj:IsA("BasePart") or obj:IsA("UnionOperation") then
  193.             obj.Massless = true
  194.             obj.Locked = true
  195.         end
  196.     end
  197.     if kill == true then
  198.         pc.Archivable = true
  199.         local old_pc = pc
  200.         pc = pc:Clone()
  201.         for i,v in pairs(pc:GetDescendants()) do
  202.             limb_collide(v,true)
  203.             if v:IsA("ParticleEmitter") then
  204.                 v.Enabled = false
  205.             end
  206.             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
  207.                 if v:IsA("BodyVelocity") then
  208.                     game:GetService("Debris"):AddItem(v,0.15)
  209.                 else
  210.                     v:Destroy()
  211.                 end
  212.             end
  213.             if (v:IsA("Script") and v.Name == 'Health') or (v:IsA("LocalScript") and v.Name == 'Animate') then
  214.                 v:Destroy()
  215.             end
  216.             if v:IsA("Humanoid") then
  217.                 v.BreakJointsOnDeath = false
  218.                 v.Health = 0
  219.                 v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  220.                 v.PlatformStand = true
  221.             end
  222.         end
  223.         for i,v in pairs(old_pc:GetDescendants()) do
  224.             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
  225.                 v:destroy()
  226.             end
  227.             if v:IsA("Humanoid") then
  228.                 v.BreakJointsOnDeath = true
  229.                 v.Health = 0
  230.                 v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  231.                 v.PlatformStand = true
  232.             end
  233.         end
  234.         pc.Parent = workspace
  235.         game:GetService("Debris"):AddItem(pc,30)
  236.     end
  237.     --if kill and targhum:FindFirstChild("Ragdolled") then return; end;
  238.     if pc ~= nil then
  239.         local hum = pc:FindFirstChild'Humanoid'
  240.         local LArm = pc:FindFirstChild'Left Arm'
  241.         local RArm = pc:FindFirstChild'Right Arm'
  242.         local LLeg = pc:FindFirstChild'Left Leg'
  243.         local RLeg = pc:FindFirstChild'Right Leg'
  244.         local torso = pc:FindFirstChild'Torso'
  245.         local head = pc:FindFirstChild'Head'
  246.        
  247.        
  248.         local LUA = pc:FindFirstChild'LeftUpperArm'
  249.         local LLA = pc:FindFirstChild'LeftLowerArm'
  250.         local LH = pc:FindFirstChild'LeftHand'
  251.        
  252.         local RUA = pc:FindFirstChild'RightUpperArm'
  253.         local RLA = pc:FindFirstChild'RightLowerArm'
  254.         local RH = pc:FindFirstChild'RightHand'
  255.        
  256.         local LUL = pc:FindFirstChild'LeftUpperLeg'
  257.         local LLL = pc:FindFirstChild'LeftLowerLeg'
  258.         local LF = pc:FindFirstChild'LeftFoot'
  259.        
  260.         local RUL = pc:FindFirstChild'RightUpperLeg'
  261.         local RLL = pc:FindFirstChild'RightLowerLeg'
  262.         local RF = pc:FindFirstChild'RightFoot'
  263.        
  264.         local UT = pc:FindFirstChild'UpperTorso'
  265.         local LT = pc:FindFirstChild'LowerTorso'
  266.        
  267.         if hum and LArm and RArm and LLeg and RLeg and head then
  268.             hum.BreakJointsOnDeath = false
  269.             if insta then
  270.                 if hum.RigType==Enum.HumanoidRigType.R6 then
  271.                     for _,v in pairs(torso:GetDescendants()) do
  272.                         if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA('Weld') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
  273.                             if not kill then
  274.                                 table.insert(js2,1,{obj = v,par = v.Parent})
  275.                                 v.Parent = nil
  276.                             elseif kill then
  277.                                 v:Destroy()
  278.                             end
  279.                         end
  280.                     end
  281.                    local vis = false
  282.                    local vis2 = false
  283.                     if LArm and not LArm:FindFirstChild('Dismembered') then
  284.                        local at1 = Instance.new("Attachment")
  285.                        at1.Parent = torso
  286.                        at1.Visible = vis
  287.                        at1.Orientation = torso.Orientation + Vector3.new(0,180,0)
  288.                        at1.Position = Vector3.new(-1,1,0)
  289.                                        
  290.                        local at1p2 = Instance.new("Attachment")
  291.                        at1p2.Parent = LArm
  292.                        at1p2.Visible = vis
  293.                        at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0)
  294.                        at1p2.Position = Vector3.new(.5,1,0)
  295.                            
  296.                        local bis = Instance.new("BallSocketConstraint")
  297.                        bis.Parent = LArm
  298.                        bis.Attachment0 = at1
  299.                        bis.Attachment1 = at1p2
  300.                        bis.LimitsEnabled = true
  301.                        bis.UpperAngle = 15
  302.                        bis.Visible = vis2
  303.                        bis.TwistLimitsEnabled = true
  304.                        bis.UpperAngle = -45
  305.                        bis.TwistLowerAngle = -45
  306.                         table.insert(js,1,bis)
  307.                     end
  308.                     if RArm and not RArm:FindFirstChild('Dismembered') then    
  309.                         local at2 = Instance.new("Attachment")
  310.                         at2.Parent = torso
  311.                         at2.Visible = vis
  312.                         at2.Orientation = torso.Orientation + Vector3.new(0,0,0)
  313.                         at2.Position = Vector3.new(1,1,0)
  314.                                
  315.                         local at2p2 = Instance.new("Attachment")
  316.                         at2p2.Parent = RArm
  317.                         at2p2.Visible = vis
  318.                         at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0)
  319.                         at2p2.Position = Vector3.new(-.5,1,0)
  320.                        
  321.                         local bis2 = Instance.new("BallSocketConstraint")
  322.                         bis2.Parent = RArm
  323.                         bis2.Attachment0 = at2
  324.                         bis2.Attachment1 = at2p2
  325.                         bis2.LimitsEnabled = true
  326.                         bis2.UpperAngle = 15
  327.                         bis2.Visible = vis2
  328.                         bis2.TwistLimitsEnabled = true
  329.                         bis2.UpperAngle = -45
  330.                         bis2.TwistLowerAngle = -45
  331.                         table.insert(js,1,bis2)
  332.                     end
  333.                      if RLeg and not RLeg:FindFirstChild('Dismembered') then
  334.                         local at3 = Instance.new("Attachment")
  335.                         at3.Parent = torso
  336.                         at3.Visible = vis
  337.                         at3.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  338.                         at3.Position = Vector3.new(.5,-1,0)
  339.                                
  340.                         local at3p2 = Instance.new("Attachment")
  341.                         at3p2.Parent = RLeg
  342.                         at3p2.Visible = vis
  343.                         at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90)
  344.                         at3p2.Position = Vector3.new(0,1,0)
  345.                        
  346.                         local bis3 = Instance.new("BallSocketConstraint")
  347.                         bis3.Parent = RLeg
  348.                         bis3.Attachment0 = at3
  349.                         bis3.Attachment1 = at3p2
  350.                         bis3.LimitsEnabled = true
  351.                         bis3.UpperAngle = 180-15
  352.                         bis3.Visible = vis2
  353.                         table.insert(js,1,bis3)
  354.                     end
  355.                          
  356.                     if LLeg and not LLeg:FindFirstChild('Dismembered') then  
  357.                         local at4 = Instance.new("Attachment")
  358.                         at4.Parent = torso
  359.                         at4.Visible = vis
  360.                         at4.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  361.                         at4.Position = Vector3.new(-.5,-1,0)
  362.                                
  363.                         local at4p2 = Instance.new("Attachment")
  364.                         at4p2.Parent = LLeg
  365.                         at4p2.Visible = vis
  366.                         at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90)
  367.                         at4p2.Position = Vector3.new(0,1,0)
  368.                    
  369.                         local bis4 = Instance.new("BallSocketConstraint")
  370.                         bis4.Parent = LLeg
  371.                         bis4.Attachment0 = at4
  372.                         bis4.Attachment1 = at4p2
  373.                         bis4.LimitsEnabled = true
  374.                         bis4.UpperAngle = 180-15
  375.                         bis4.Visible = vis2
  376.                         table.insert(js,1,bis4)
  377.                     end
  378.                    
  379.                     if head and not headless and not head:FindFirstChild('Dismembered') then  
  380.                             local at5 = Instance.new("Attachment")
  381.                             at5.Parent = torso
  382.                             at5.Visible = vis
  383.                             at5.Orientation = torso.Orientation + Vector3.new(180,90,0)
  384.                             at5.Position = Vector3.new(0,1,0)
  385.                          
  386.                             local at5p2 = Instance.new("Attachment")
  387.                             at5p2.Parent = head
  388.                             at5p2.Visible = vis
  389.                             at5p2.Orientation = head.Orientation + Vector3.new(180,90,0)
  390.                             at5p2.Position = Vector3.new(0,-.5,0)
  391.                    
  392.                             local bis5 = Instance.new("BallSocketConstraint")
  393.                             bis5.Parent = head
  394.                             bis5.Attachment0 = at5p2
  395.                             bis5.Attachment1 = at5
  396.                             bis5.LimitsEnabled = true
  397.                             bis5.UpperAngle = 75
  398.                             bis5.Visible = vis2
  399.                             bis5.TwistLimitsEnabled = true
  400.                             bis5.UpperAngle = -45
  401.                             bis5.TwistLowerAngle = -45
  402.                             table.insert(js,1,bis5)
  403.                         else
  404.                             --head:BreakJoints()
  405.                         end
  406.                     end
  407.             else
  408.                 hum.Died:Connect(function()
  409.                 if hum.RigType==Enum.HumanoidRigType.R6 then
  410.                     for _,v in pairs(torso:GetDescendants()) do
  411.                         if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA('Weld') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
  412.                             if not kill then
  413.                                 table.insert(js2,1,{obj = v,par = v.Parent})
  414.                                 v.Parent = nil
  415.                             elseif kill then
  416.                                 v:Destroy()
  417.                             end
  418.                         end
  419.                     end
  420.                    local vis = false
  421.                    local vis2 = false
  422.                     if LArm and not LArm:FindFirstChild('Dismembered') then
  423.                        local at1 = Instance.new("Attachment")
  424.                        at1.Parent = torso
  425.                        at1.Visible = vis
  426.                        at1.Orientation = torso.Orientation + Vector3.new(0,180,0)
  427.                        at1.Position = Vector3.new(-1,1,0)
  428.                                        
  429.                        local at1p2 = Instance.new("Attachment")
  430.                        at1p2.Parent = LArm
  431.                        at1p2.Visible = vis
  432.                        at1p2.Orientation = LArm.Orientation + Vector3.new(0,180,0)
  433.                        at1p2.Position = Vector3.new(.5,1,0)
  434.                            
  435.                        local bis = Instance.new("BallSocketConstraint")
  436.                        bis.Parent = LArm
  437.                        bis.Attachment0 = at1
  438.                        bis.Attachment1 = at1p2
  439.                        bis.LimitsEnabled = true
  440.                        bis.UpperAngle = 15
  441.                        bis.Visible = vis2
  442.                        bis.TwistLimitsEnabled = true
  443.                        bis.UpperAngle = -45
  444.                        bis.TwistLowerAngle = -45
  445.                         table.insert(js,1,bis)
  446.                     end
  447.                     if RArm and not RArm:FindFirstChild('Dismembered') then    
  448.                         local at2 = Instance.new("Attachment")
  449.                         at2.Parent = torso
  450.                         at2.Visible = vis
  451.                         at2.Orientation = torso.Orientation + Vector3.new(0,0,0)
  452.                         at2.Position = Vector3.new(1,1,0)
  453.                                
  454.                         local at2p2 = Instance.new("Attachment")
  455.                         at2p2.Parent = RArm
  456.                         at2p2.Visible = vis
  457.                         at2p2.Orientation = RArm.Orientation + Vector3.new(0,0,0)
  458.                         at2p2.Position = Vector3.new(-.5,1,0)
  459.                        
  460.                         local bis2 = Instance.new("BallSocketConstraint")
  461.                         bis2.Parent = RArm
  462.                         bis2.Attachment0 = at2
  463.                         bis2.Attachment1 = at2p2
  464.                         bis2.LimitsEnabled = true
  465.                         bis2.UpperAngle = 15
  466.                         bis2.Visible = vis2
  467.                         bis2.TwistLimitsEnabled = true
  468.                         bis2.UpperAngle = -45
  469.                         bis2.TwistLowerAngle = -45
  470.                         table.insert(js,1,bis2)
  471.                     end
  472.                      if RLeg and not RLeg:FindFirstChild('Dismembered') then
  473.                         local at3 = Instance.new("Attachment")
  474.                         at3.Parent = torso
  475.                         at3.Visible = vis
  476.                         at3.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  477.                         at3.Position = Vector3.new(.5,-1,0)
  478.                                
  479.                         local at3p2 = Instance.new("Attachment")
  480.                         at3p2.Parent = RLeg
  481.                         at3p2.Visible = vis
  482.                         at3p2.Orientation = RLeg.Orientation + Vector3.new(90,0,-90)
  483.                         at3p2.Position = Vector3.new(0,1,0)
  484.                        
  485.                         local bis3 = Instance.new("BallSocketConstraint")
  486.                         bis3.Parent = RLeg
  487.                         bis3.Attachment0 = at3
  488.                         bis3.Attachment1 = at3p2
  489.                         bis3.LimitsEnabled = true
  490.                         bis3.UpperAngle = 180-15
  491.                         bis3.Visible = vis2
  492.                         table.insert(js,1,bis3)
  493.                     end
  494.                          
  495.                     if LLeg and not LLeg:FindFirstChild('Dismembered') then  
  496.                         local at4 = Instance.new("Attachment")
  497.                         at4.Parent = torso
  498.                         at4.Visible = vis
  499.                         at4.Orientation = torso.Orientation + Vector3.new(90,0,-90)
  500.                         at4.Position = Vector3.new(-.5,-1,0)
  501.                                
  502.                         local at4p2 = Instance.new("Attachment")
  503.                         at4p2.Parent = LLeg
  504.                         at4p2.Visible = vis
  505.                         at4p2.Orientation = LLeg.Orientation + Vector3.new(90,0,-90)
  506.                         at4p2.Position = Vector3.new(0,1,0)
  507.                    
  508.                         local bis4 = Instance.new("BallSocketConstraint")
  509.                         bis4.Parent = LLeg
  510.                         bis4.Attachment0 = at4
  511.                         bis4.Attachment1 = at4p2
  512.                         bis4.LimitsEnabled = true
  513.                         bis4.UpperAngle = 180-15
  514.                         bis4.Visible = vis2
  515.                         table.insert(js,1,bis4)
  516.                     end
  517.                    
  518.                     if head and not headless and not head:FindFirstChild('Dismembered') then  
  519.                             local at5 = Instance.new("Attachment")
  520.                             at5.Parent = torso
  521.                             at5.Visible = vis
  522.                             at5.Orientation = torso.Orientation + Vector3.new(180,90,0)
  523.                             at5.Position = Vector3.new(0,1,0)
  524.                          
  525.                             local at5p2 = Instance.new("Attachment")
  526.                             at5p2.Parent = head
  527.                             at5p2.Visible = vis
  528.                             at5p2.Orientation = head.Orientation + Vector3.new(180,90,0)
  529.                             at5p2.Position = Vector3.new(0,-.5,0)
  530.                    
  531.                             local bis5 = Instance.new("BallSocketConstraint")
  532.                             bis5.Parent = head
  533.                             bis5.Attachment0 = at5p2
  534.                             bis5.Attachment1 = at5
  535.                             bis5.LimitsEnabled = true
  536.                             bis5.UpperAngle = 75
  537.                             bis5.Visible = vis2
  538.                             bis5.TwistLimitsEnabled = true
  539.                             bis5.UpperAngle = -45
  540.                             bis5.TwistLowerAngle = -45
  541.                             table.insert(js,1,bis5)
  542.                         else
  543.                             --head:BreakJoints()
  544.                         end
  545.                     end
  546.                 end)
  547.             end
  548.         elseif head and hum then
  549.             hum.BreakJointsOnDeath = false
  550.             if insta then
  551.                 if hum.RigType==Enum.HumanoidRigType.R15 then
  552.                     for _,v in pairs(pc:GetDescendants()) do
  553.                         if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
  554.                             if not kill then
  555.                                 table.insert(js2,1,{obj = v,par = v.Parent})
  556.                                 v.Parent = nil
  557.                             elseif kill then
  558.                                 v:Destroy()
  559.                             end
  560.                         end
  561.                     end
  562.                     local vis = false
  563.                     local vis2 = false
  564.                        
  565.                     if LF and not LF:FindFirstChild('Dismembered') then  
  566.                         local bsc1 = Instance.new("BallSocketConstraint",LF)
  567.                         bsc1.Attachment0 = LF.LeftAnkleRigAttachment
  568.                         bsc1.Attachment1 = LLL.LeftAnkleRigAttachment
  569.                         table.insert(js,1,bsc1)
  570.                     end
  571.                     if LLL and not LLL:FindFirstChild('Dismembered') then  
  572.                         local bsc2 = Instance.new("BallSocketConstraint",LLL)
  573.                         bsc2.Attachment0 = LLL.LeftKneeRigAttachment
  574.                         bsc2.Attachment1 = LUL.LeftKneeRigAttachment
  575.                         table.insert(js,1,bsc2)
  576.                     end
  577.                     if LUL and not LUL:FindFirstChild('Dismembered') then  
  578.                         local bsc3 = Instance.new("BallSocketConstraint",LUL)
  579.                         bsc3.Attachment0 = LUL.LeftHipRigAttachment
  580.                         bsc3.Attachment1 = LT.LeftHipRigAttachment
  581.                         table.insert(js,1,bsc3)
  582.                     end
  583.                     if RF and not RF:FindFirstChild('Dismembered') then  
  584.                         local bsc4 = Instance.new("BallSocketConstraint",RF)
  585.                         bsc4.Attachment0 = RF.RightAnkleRigAttachment
  586.                         bsc4.Attachment1 = RLL.RightAnkleRigAttachment
  587.                         table.insert(js,1,bsc4)
  588.                     end
  589.                     if RLL and not RLL:FindFirstChild('Dismembered') then  
  590.                         local bsc5 = Instance.new("BallSocketConstraint",RLL)
  591.                         bsc5.Attachment0 = RLL.RightKneeRigAttachment
  592.                         bsc5.Attachment1 = RUL.RightKneeRigAttachment
  593.                         table.insert(js,1,bsc5)
  594.                     end
  595.                     if RUL and not RUL:FindFirstChild('Dismembered') then  
  596.                         local bsc6 = Instance.new("BallSocketConstraint",RUL)
  597.                         bsc6.Attachment0 = RUL.RightHipRigAttachment
  598.                         bsc6.Attachment1 = LT.RightHipRigAttachment
  599.                         table.insert(js,1,bsc6)
  600.                     end
  601.                     if LH and not LH:FindFirstChild('Dismembered') then  
  602.                         local bsc7 = Instance.new("BallSocketConstraint",LH)
  603.                         bsc7.Attachment0 = LH.LeftWristRigAttachment
  604.                         bsc7.Attachment1 = LLA.LeftWristRigAttachment
  605.                         table.insert(js,1,bsc7)
  606.                     end
  607.                     if LLA and not LLA:FindFirstChild('Dismembered') then  
  608.                         local bsc8 = Instance.new("BallSocketConstraint",LLA)
  609.                         bsc8.Attachment0 = LLA.LeftElbowRigAttachment
  610.                         bsc8.Attachment1 = LUA.LeftElbowRigAttachment
  611.                         table.insert(js,1,bsc8)
  612.                     end
  613.                     if LUA and not LUA:FindFirstChild('Dismembered') then  
  614.                         local bsc9 = Instance.new("BallSocketConstraint",LUA)
  615.                         bsc9.Attachment0 = LUA.LeftShoulderAttachment
  616.                         bsc9.Attachment1 = UT.LeftCollarAttachment
  617.                         table.insert(js,1,bsc9)
  618.                     end
  619.                     if RH and not RH:FindFirstChild('Dismembered') then  
  620.                         local bsc10 = Instance.new("BallSocketConstraint",RH)
  621.                         bsc10.Attachment0 = RH.RightWristRigAttachment
  622.                         bsc10.Attachment1 = RLA.RightWristRigAttachment
  623.                         table.insert(js,1,bsc10)
  624.                     end
  625.                     if RLA and not RLA:FindFirstChild('Dismembered') then  
  626.                         local bsc11 = Instance.new("BallSocketConstraint",RLA)
  627.                         bsc11.Attachment0 = RLA.RightElbowRigAttachment
  628.                         bsc11.Attachment1 = RUA.RightElbowRigAttachment
  629.                         table.insert(js,1,bsc11)
  630.                     end
  631.                     if RUA and not RUA:FindFirstChild('Dismembered') then  
  632.                         local bsc12 = Instance.new("BallSocketConstraint",RUA)
  633.                         bsc12.Attachment0 = RUA.RightShoulderAttachment
  634.                         bsc12.Attachment1 = UT.RightCollarAttachment
  635.                         table.insert(js,1,bsc12)
  636.                     end
  637.                     if LT and not LT:FindFirstChild('Dismembered') then  
  638.                         local bsc13 = Instance.new("BallSocketConstraint",LT)
  639.                         bsc13.Attachment0 = LT.WaistRigAttachment
  640.                         bsc13.Attachment1 = UT.WaistRigAttachment
  641.                         table.insert(js,1,bsc13)
  642.                     end
  643.                     if head and not headless and not head:FindFirstChild('Dismembered')  then
  644.                         local bsc14 = Instance.new("BallSocketConstraint",head)
  645.                         bsc14.Attachment0 = UT.NeckRigAttachment
  646.                         bsc14.Attachment1 = head.NeckRigAttachment
  647.                         bsc14.LimitsEnabled = true
  648.                         bsc14.UpperAngle = -75
  649.                         bsc14.TwistLimitsEnabled = true
  650.                         bsc14.UpperAngle = -45
  651.                         bsc14.TwistLowerAngle = -45
  652.                         table.insert(js,1,bsc14)
  653.                     else
  654.                         --head:BreakJoints()
  655.                     end
  656.                 end
  657.             else
  658.                 hum.Died:Connect(function()
  659.                     if hum.RigType==Enum.HumanoidRigType.R15 then
  660.                         for _,v in pairs(pc:GetDescendants()) do
  661.                             if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA("BallSocketConstraint")) and (not string.match(v.Name:lower(),'root')) then
  662.                                 if not kill then
  663.                                     table.insert(js2,1,{obj = v,par = v.Parent})
  664.                                     v.Parent = nil
  665.                                 elseif kill then
  666.                                     v:Destroy()
  667.                                 end
  668.                             end
  669.                         end
  670.                         local vis = false
  671.                         local vis2 = false
  672.                            
  673.                         if LF and not LF:FindFirstChild('Dismembered') then  
  674.                             local bsc1 = Instance.new("BallSocketConstraint",LF)
  675.                             bsc1.Attachment0 = LF.LeftAnkleRigAttachment
  676.                             bsc1.Attachment1 = LLL.LeftAnkleRigAttachment
  677.                             table.insert(js,1,bsc1)
  678.                         end
  679.                         if LLL and not LLL:FindFirstChild('Dismembered') then  
  680.                             local bsc2 = Instance.new("BallSocketConstraint",LLL)
  681.                             bsc2.Attachment0 = LLL.LeftKneeRigAttachment
  682.                             bsc2.Attachment1 = LUL.LeftKneeRigAttachment
  683.                             table.insert(js,1,bsc2)
  684.                         end
  685.                         if LUL and not LUL:FindFirstChild('Dismembered') then  
  686.                             local bsc3 = Instance.new("BallSocketConstraint",LUL)
  687.                             bsc3.Attachment0 = LUL.LeftHipRigAttachment
  688.                             bsc3.Attachment1 = LT.LeftHipRigAttachment
  689.                             table.insert(js,1,bsc3)
  690.                         end
  691.                         if RF and not RF:FindFirstChild('Dismembered') then  
  692.                             local bsc4 = Instance.new("BallSocketConstraint",RF)
  693.                             bsc4.Attachment0 = RF.RightAnkleRigAttachment
  694.                             bsc4.Attachment1 = RLL.RightAnkleRigAttachment
  695.                             table.insert(js,1,bsc4)
  696.                         end
  697.                         if RLL and not RLL:FindFirstChild('Dismembered') then  
  698.                             local bsc5 = Instance.new("BallSocketConstraint",RLL)
  699.                             bsc5.Attachment0 = RLL.RightKneeRigAttachment
  700.                             bsc5.Attachment1 = RUL.RightKneeRigAttachment
  701.                             table.insert(js,1,bsc5)
  702.                         end
  703.                         if RUL and not RUL:FindFirstChild('Dismembered') then  
  704.                             local bsc6 = Instance.new("BallSocketConstraint",RUL)
  705.                             bsc6.Attachment0 = RUL.RightHipRigAttachment
  706.                             bsc6.Attachment1 = LT.RightHipRigAttachment
  707.                             table.insert(js,1,bsc6)
  708.                         end
  709.                         if LH and not LH:FindFirstChild('Dismembered') then  
  710.                             local bsc7 = Instance.new("BallSocketConstraint",LH)
  711.                             bsc7.Attachment0 = LH.LeftWristRigAttachment
  712.                             bsc7.Attachment1 = LLA.LeftWristRigAttachment
  713.                             table.insert(js,1,bsc7)
  714.                         end
  715.                         if LLA and not LLA:FindFirstChild('Dismembered') then  
  716.                             local bsc8 = Instance.new("BallSocketConstraint",LLA)
  717.                             bsc8.Attachment0 = LLA.LeftElbowRigAttachment
  718.                             bsc8.Attachment1 = LUA.LeftElbowRigAttachment
  719.                             table.insert(js,1,bsc8)
  720.                         end
  721.                         if LUA and not LUA:FindFirstChild('Dismembered') then  
  722.                             local bsc9 = Instance.new("BallSocketConstraint",LUA)
  723.                             bsc9.Attachment0 = LUA.LeftShoulderAttachment
  724.                             bsc9.Attachment1 = UT.LeftCollarAttachment
  725.                             table.insert(js,1,bsc9)
  726.                         end
  727.                         if RH and not RH:FindFirstChild('Dismembered') then  
  728.                             local bsc10 = Instance.new("BallSocketConstraint",RH)
  729.                             bsc10.Attachment0 = RH.RightWristRigAttachment
  730.                             bsc10.Attachment1 = RLA.RightWristRigAttachment
  731.                             table.insert(js,1,bsc10)
  732.                         end
  733.                         if RLA and not RLA:FindFirstChild('Dismembered') then  
  734.                             local bsc11 = Instance.new("BallSocketConstraint",RLA)
  735.                             bsc11.Attachment0 = RLA.RightElbowRigAttachment
  736.                             bsc11.Attachment1 = RUA.RightElbowRigAttachment
  737.                             table.insert(js,1,bsc11)
  738.                         end
  739.                         if RUA and not RUA:FindFirstChild('Dismembered') then  
  740.                             local bsc12 = Instance.new("BallSocketConstraint",RUA)
  741.                             bsc12.Attachment0 = RUA.RightShoulderAttachment
  742.                             bsc12.Attachment1 = UT.RightCollarAttachment
  743.                             table.insert(js,1,bsc12)
  744.                         end
  745.                         if LT and not LT:FindFirstChild('Dismembered') then  
  746.                             local bsc13 = Instance.new("BallSocketConstraint",LT)
  747.                             bsc13.Attachment0 = LT.WaistRigAttachment
  748.                             bsc13.Attachment1 = UT.WaistRigAttachment
  749.                             table.insert(js,1,bsc13)
  750.                         end
  751.                         if head and not headless and not head:FindFirstChild('Dismembered')  then
  752.                             local bsc14 = Instance.new("BallSocketConstraint",head)
  753.                             bsc14.Attachment0 = UT.NeckRigAttachment
  754.                             bsc14.Attachment1 = head.NeckRigAttachment
  755.                             bsc14.LimitsEnabled = true
  756.                             bsc14.UpperAngle = -75
  757.                             bsc14.TwistLimitsEnabled = true
  758.                             bsc14.UpperAngle = -45
  759.                             bsc14.TwistLowerAngle = -45
  760.                             table.insert(js,1,bsc14)
  761.                         else
  762.                             --head:BreakJoints()
  763.                         end
  764.                     end
  765.                 end)
  766.             end
  767.         end
  768.     end
  769.     return js,js2
  770. end
  771. function kill(obj,headshot,lookVector)
  772.     local targchar,targhead,targtorso,targhum,killval
  773.     pcall(function()
  774.         targchar = obj.Parent
  775.     end)
  776.     for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  777.         if v and v.Character and obj:IsDescendantOf(v.Character) then
  778.             targchar = v.Character
  779.         end
  780.     end
  781.     pcall(function()
  782.         targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("HumanoidRootPart")
  783.     end)
  784.     pcall(function()
  785.         targhead = targchar:FindFirstChild("Head")
  786.     end)
  787.     pcall(function()
  788.         targhum = targchar:FindFirstChildOfClass("Humanoid")
  789.     end)
  790.     pcall(function()
  791.         killval = targhum:FindFirstChild("killer")
  792.     end)
  793.     pcall(function()
  794.         decapval = targhum:FindFirstChild("decapped " .. targchar.Name)
  795.     end)
  796.     if targchar and targhead and targtorso and targhum and targhum ~= hum and using then
  797.         targhum:TakeDamage(1/0)
  798.         if 0 >= targhum.Health then
  799.             if (not decapval and headshot) or not killval then
  800.                 if not killval then
  801.                     local tempkillval = Instance.new("ObjectValue",targhum)
  802.                     tempkillval.Name = "killer"
  803.                     tempkillval.Value = plr
  804.                 end
  805.                 local kb = 15
  806.                 local bv = Instance.new("BodyVelocity")
  807.                 bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  808.                 bv.Velocity = lookVector*kb+Vector3.new(0,kb,0)
  809.                 bv.Parent = targtorso
  810.                 game:GetService("Debris"):AddItem(bv,0.1)
  811.                 local ragval = Instance.new("ObjectValue")
  812.                 ragval.Name = 'Ragdolled'
  813.                 ragval.Parent = targhum
  814.                 Ragdoll(targchar,headshot,true,true)
  815.                 --bleed2(targtorso,targhum,true,5,true)
  816.             end
  817.             if headshot and not decapval then
  818.                 local tempdecapval = Instance.new("ObjectValue",targhum)
  819.                 tempdecapval.Name = ("decapped " .. targchar.Name)
  820.                 --[[
  821.                 local decap_bleed = Instance.new("Sound")
  822.                 decap_bleed.SoundId = 'rbxassetid://244502094'
  823.                 decap_bleed.Volume = 0.5
  824.                 decap_bleed.Parent = targtorso
  825.                 decap_bleed:Play()
  826.                 local decap_head = Instance.new("Sound")
  827.                 decap_head.SoundId = 'rbxassetid://1255040462' --222406108
  828.                 decap_head.Volume = 1
  829.                 decap_head.Parent = targtorso
  830.                 decap_head:Play()
  831.                 ]]
  832.                 remote:FireClient(plr,1,'rbxassetid://244502094',nil,0.5,targtorso)
  833.                 remote:FireClient(plr,1,'rbxassetid://1255040462',nil,1,targtorso)
  834.                 local att = Instance.new("Attachment")
  835.                 att.Parent = targtorso
  836.                 att.Position = Vector3.new(0,targtorso.Size.Y/2,0)
  837.                 local blood_emitter = Instance.new("ParticleEmitter")
  838.                 blood_emitter.Name = "Blood2"
  839.                 blood_emitter.Parent = att
  840.                 blood_emitter.Speed = NumberRange.new(5, 14)
  841.                 blood_emitter.Color = ColorSequence.new(Color3.new(0.45098, 0, 0),Color3.new(0.45098, 0, 0))
  842.                 blood_emitter.LightEmission = 0.20000000298023
  843.                 blood_emitter.LightInfluence = 1
  844.                 blood_emitter.Texture = "http://www.roblox.com/asset/?id=134531274"
  845.                 blood_emitter.Transparency = NumberSequence.new(0.30000001192093,0.30000001192093)
  846.                 blood_emitter.ZOffset = 0
  847.                 blood_emitter.Size = NumberSequence.new(0.12499988079071,0)
  848.                 blood_emitter.Acceleration = Vector3.new(0, -20, 0)
  849.                 blood_emitter.Lifetime = NumberRange.new(0.5, 1.5)
  850.                 blood_emitter.Rate = 100000
  851.                 blood_emitter.SpreadAngle = Vector2.new(90, 90)
  852.                 blood_emitter.VelocitySpread = 90
  853.                 blood_emitter.Enabled = true
  854.                 spawn(function()
  855.                     wait(5)
  856.                     blood_emitter.Enabled = false
  857.                     game:GetService("Debris"):AddItem(blood_emitter,2)
  858.                 end)
  859.             end
  860.         end
  861.     end
  862. end
  863. function bleed2(frick,targhum,can_hurt,t,splat)
  864.     --spawn(function()
  865.     if not frick:FindFirstChild("bleeding from kry's " .. gun.Name) then else return end
  866.     local tempbleedval = Instance.new("ObjectValue")
  867.     tempbleedval.Name = "bleeding from kry's " .. gun.Name
  868.     tempbleedval.Parent = frick
  869.     local bleeding = true
  870.     local rig = targhum.RigType
  871.     local limbs = {'Head','Left Arm','Right Arm','Left Leg','Right Leg','RightUpperLeg','LeftUpperLeg','RightUpperArm','LeftUpperArm','RightLowerLeg','LeftLowerLeg','RightLowerArm','LeftLowerArm','RightFoot','LeftFoot','RightHand','LeftHand'}
  872.     spawn(function()
  873.         wait(t)
  874.         bleeding = false
  875.         tempbleedval:Destroy()
  876.     end)
  877.     while bleeding and frick and frick.Parent do
  878.         if --[[(targhum and targhum.Parent and targhum.Health > 0) or]] (not frick or not frick.Parent or not targhum or not targhum.Parent) then
  879.             break
  880.         end
  881.         local max_limbs = 0
  882.         local current_limbs = 0
  883.         local gone_limbs = 0
  884.         local targchar = targhum.Parent
  885.         if rig == Enum.HumanoidRigType.R6 then
  886.             max_limbs = 5
  887.         elseif rig == Enum.HumanoidRigType.R15 then
  888.             max_limbs = 13
  889.         end
  890.         for i,v in pairs(targchar:GetChildren()) do
  891.             local found = false
  892.             for i,n in pairs(limbs) do if n == v.Name then found = true; end; end;
  893.             if found and not v:FindFirstChild("Dismembered") then
  894.                 current_limbs = current_limbs + 1
  895.             end
  896.         end
  897.         gone_limbs = (max_limbs-current_limbs)
  898.         if targhum and can_hurt then
  899.             if gone_limbs >= 1 then
  900.                 targhum:TakeDamage(0.5*gone_limbs)
  901.             else
  902.                 targhum:TakeDamage(0.5)
  903.             end
  904.         end
  905.         spawn(function()
  906.             local thing = Instance.new('Part')
  907.             thing.Parent = workspace
  908.             thing.Size = Vector3.new(0.1,0.1,0.1)
  909.             thing.CFrame = frick.CFrame*CFrame.new(0,frick.Size.Y/2,0)
  910.             if splat then
  911.                 thing.Transparency = 0
  912.             elseif not splat then
  913.                 thing.Transparency = 1
  914.             end
  915.             thing.Color = Color3.fromRGB(75, 0, 0)
  916.             thing.Material = Enum.Material.Glass
  917.             thing.Name = "blood_drop"
  918.             thing.CanCollide =false
  919.             thing:BreakJoints()
  920.             local mesh = Instance.new('SpecialMesh')
  921.             mesh.MeshType = Enum.MeshType.Sphere
  922.             mesh.Parent = thing
  923.             --game:GetService("Debris"):AddItem(thing,5)
  924.             local att1,att2 = Instance.new("Attachment"),Instance.new("Attachment")
  925.             att1.Parent = thing
  926.             att1.Position = Vector3.new(0,-(thing.Size.Y/2),0)
  927.             att2.Parent = thing
  928.             att2.Position = Vector3.new(0,(thing.Size.Y/2),0)
  929.             if splat then
  930.                 local trail_drop = Instance.new("Trail")
  931.                 trail_drop.Parent = thing
  932.                 trail_drop.Attachment0 = att1
  933.                 trail_drop.Attachment1 = att2
  934.                 trail_drop.Color = ColorSequence.new(Color3.new(0.294118, 0, 0),Color3.new(0.294118, 0, 0))
  935.                 trail_drop.FaceCamera = true
  936.                 trail_drop.LightInfluence = 1
  937.                 trail_drop.Transparency = NumberSequence.new(0.1,1)
  938.                 trail_drop.Lifetime = 1
  939.                 trail_drop.MinLength = 0
  940.             end
  941.             local rawrxd = Instance.new('BodyForce')
  942.             rawrxd.Parent = thing
  943.             if splat then
  944.                 rawrxd.Force = frick.CFrame.upVector+Vector3.new(math.random(-5, 5)/10,3,math.random(-5, 5)/10)
  945.             elseif not splat then
  946.                 rawrxd.Force = frick.CFrame.upVector*(math.random()*2)+Vector3.new(math.random(-5, 5)/10,1.5,0)
  947.             end
  948.             game:GetService("Debris"):AddItem(rawrxd,0.01)
  949.             thing.Touched:connect(function(tou)
  950.                 if tou and tou.Parent and not tou:IsDescendantOf(targchar) 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
  951.                     local pos = Vector3.new(thing.Position.X,(tou.Position.Y+(tou.Size.Y/2))+(0.02/2),thing.Position.Z)
  952.                     local Point1 = pos-Vector3.new(0.01,0.01,0.01)
  953.                     local Point2 = pos+Vector3.new(0.01,0.01,0.01)
  954.                     local Region = Region3.new(Point1,Point2)
  955.                     for _,Part in pairs(game.Workspace:FindPartsInRegion3(Region,nil,math.huge)) do
  956.                         if Part.Name == "blood" then
  957.                             tou = Part
  958.                         end
  959.                     end
  960.                     thing:Destroy()
  961.                     if tou.Name == "blood" then
  962.                         local reee = tou.CFrame
  963.                         if tou.Transparency > -0.2 then
  964.                             tou.Transparency = tou.Transparency - 0.1
  965.                         end
  966.                         if tou.Size.X < 5 then
  967.                             tou.Size = tou.Size+Vector3.new(0.4,0,0.4)
  968.                             tou.CFrame = reee
  969.                         elseif tou.Size.X < 7.5 then
  970.                             tou.Size = tou.Size+Vector3.new(0.3,0,0.3)
  971.                             tou.CFrame = reee
  972.                         elseif tou.Size.X < 10 then
  973.                             tou.Size = tou.Size+Vector3.new(0.2,0,0.2)
  974.                             tou.CFrame = reee
  975.                         end
  976.                     elseif tou.CanCollide == true then
  977.                         local bloodlol = Instance.new('Part')
  978.                         if gone_limbs >= 1 then
  979.                             bloodlol.Size = Vector3.new(1*gone_limbs,0.2,1*gone_limbs)
  980.                         else
  981.                             bloodlol.Size = Vector3.new(1,0.2,1)
  982.                         end
  983.                         bloodlol.Name = "blood"
  984.                         bloodlol.Anchored = true
  985.                         bloodlol.CanCollide = false
  986.                         bloodlol.Material = Enum.Material.Glass
  987.                         bloodlol.Color = Color3.fromRGB(75, 0, 0)
  988.                         local mesh = Instance.new('SpecialMesh')
  989.                         mesh.MeshType = Enum.MeshType.Sphere
  990.                         mesh.Parent = bloodlol
  991.                         bloodlol.Parent = workspace
  992.                         bloodlol.CFrame = CFrame.new(pos)
  993.                         while bloodlol and bloodlol.Parent ~= nil do
  994.                             if bloodlol.Transparency < 1 then
  995.                                 bloodlol.Transparency = bloodlol.Transparency + 0.05
  996.                             else
  997.                                 bloodlol:Destroy()
  998.                             end
  999.                             wait(0.1)
  1000.                         end
  1001.                     end
  1002.                 end
  1003.             end)
  1004.         end)
  1005.         wait(0.1)
  1006.     end
  1007.     tempbleedval:Destroy()
  1008.     --end)
  1009. end
  1010.  
  1011. function Reload()
  1012.     if max_ammo > ammo then else return end
  1013.     using = true
  1014.     reload_s:Play()
  1015.     local mag = Instance.new("Part")
  1016.     mag.Name = 'gun mag'
  1017.     mag.Size = Vector3.new(0.48, 0.79, 0.14)
  1018.     mag.Color = han.Color
  1019.     mag.Parent = workspace
  1020.     mag.CFrame = han.CFrame * CFrame.new(1.2,-0.5,0)
  1021.     debris:AddItem(mag,10)
  1022.     repeat wait() until not reload_s.IsPlaying
  1023.     ammo = max_ammo
  1024.     game:GetService("Debris"):AddItem(mag,10)
  1025.     using = false
  1026. end
  1027.  
  1028. function breakwindow(hit)
  1029.     if hit and not string.match(hit.Name:lower(),"window shatter") and not string.match(hit.Name:lower(),"blood") then else return end
  1030.     local wbreakc = wbreak:Clone()
  1031.     wbreakc.Parent = hit
  1032.     wbreakc:Play()
  1033.     local sx,sy,sz=hit.Size.x,hit.Size.y,hit.Size.z
  1034.     hit.Name = "window shatter"
  1035.     for x=1,4 do
  1036.         for y=1,4 do
  1037.             local part=hit:Clone()
  1038.             local position=Vector3.new(x-2.1,y-2.1,0)*Vector3.new(sx/4,sy/4,sz)
  1039.             part.Size=Vector3.new(sx/4,sy/4,sz)
  1040.             part.CFrame=hit.CFrame*(CFrame.new(part.Size/8)-hit.Size/8+position)           
  1041.             part.Velocity=Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
  1042.             part.Name="window shatter"
  1043.             part.Parent=hit.Parent
  1044.             debris:AddItem(part,2)
  1045.             spawn(function()
  1046.                 wait(0.5)
  1047.                 for i=1,10 do
  1048.                     part.Transparency=part.Transparency+0.05
  1049.                     wait(0.05)
  1050.                 end
  1051.                 part:Destroy()
  1052.             end)
  1053.             part.Anchored=false
  1054.         end
  1055.     end
  1056.     hit:Destroy()
  1057. end
  1058.  
  1059. function raycast(Pos,Dir,Max,Ignore)
  1060.     return workspace:FindPartOnRayWithIgnoreList(Ray.new(Pos, Dir * (Max or 999.999)), (Ignore or {}), false, true)
  1061. end
  1062.  
  1063. local objhit = {}
  1064. local oldobjhit = {}
  1065.  
  1066. function make_hole(pos,obj,col)
  1067.     local BulletHolePart = Instance.new("Part")
  1068.     BulletHolePart.Massless = true
  1069.     BulletHolePart.Anchored = false
  1070.     BulletHolePart.CanCollide = false
  1071.     BulletHolePart.Locked = true
  1072.     BulletHolePart.FormFactor = "Custom"
  1073.     BulletHolePart.TopSurface, BulletHolePart.BottomSurface, BulletHolePart.RightSurface, BulletHolePart.LeftSurface, BulletHolePart.FrontSurface, BulletHolePart.BackSurface = "SmoothNoOutlines", "SmoothNoOutlines", "SmoothNoOutlines", "SmoothNoOutlines", "SmoothNoOutlines", "SmoothNoOutlines"
  1074.     BulletHolePart.Name = "Bullet Hole"
  1075.     BulletHolePart.Material = "Plastic"
  1076.     BulletHolePart.Reflectance = 0
  1077.     BulletHolePart.Transparency = 1
  1078.     BulletHolePart.BrickColor = BrickColor.new("Medium stone grey")
  1079.     BulletHolePart.Size = Vector3.new(0.3, 0, 0.3)
  1080.     BulletHolePart:BreakJoints()
  1081.     BulletHolePart.CFrame = pos
  1082.     BulletHolePart.Parent = script
  1083.     local weld = Instance.new("WeldConstraint")
  1084.     weld.Part0 = obj
  1085.     weld.Part1 = BulletHolePart
  1086.     weld.Parent = obj
  1087.    -- game:GetService("Debris"):AddItem(BulletHolePart, 5)
  1088.     --[[
  1089.     local BulletHoleDecal = Instance.new("Decal")
  1090.     BulletHoleDecal.Color3 = Color3.new(col.r, col.g, col.b)
  1091.     BulletHoleDecal.Face = "Top"
  1092.     BulletHoleDecal.Texture = "rbxassetid://359667865"
  1093.     BulletHoleDecal.Transparency = 0
  1094.     BulletHoleDecal.Parent = BulletHolePart
  1095.     ]]
  1096.     remote:FireClient(plr,2,"rbxassetid://359667865","Top",0,BulletHolePart)
  1097.     return BulletHolePart
  1098. end
  1099.  
  1100. local blood_images = {931617584,1663434319,1391189545,4533673847,3236192667,2565888666,612591729,120362139,116830967,122022304,131339257,247766282,121678640,176677800,120361912,176678070,176678086,176677869} --305296807,256293532,148713503,176678030
  1101.  
  1102. local e_s = 1
  1103.  
  1104. function add_decal(f,t,obj)
  1105.     --spawn(function()
  1106.     local texture = Instance.new("Texture")
  1107.     texture.Parent = obj
  1108.     texture.Face = f
  1109.     texture.Texture = 'rbxassetid://' .. t
  1110.     if f == 'Left' or f == 'Right' then
  1111.         texture.StudsPerTileV = obj.Size.Y + e_s
  1112.         if (obj.Size.X > obj.Size.Z) then
  1113.             texture.StudsPerTileV = obj.Size.Z + e_s
  1114.         elseif (obj.Size.Z > obj.Size.X) then
  1115.             texture.StudsPerTileU = obj.Size.X + e_s
  1116.         else
  1117.             texture.StudsPerTileU = obj.Size.X + e_s
  1118.         end
  1119.     elseif f == 'Front' or f == 'Back' then
  1120.         texture.StudsPerTileV = obj.Size.Y + e_s
  1121.         if (obj.Size.X > obj.Size.Z) then
  1122.             texture.StudsPerTileV = obj.Size.X + e_s
  1123.         elseif (obj.Size.Z > obj.Size.X) then
  1124.             texture.StudsPerTileU = obj.Size.Z + e_s
  1125.         else
  1126.             texture.StudsPerTileU = obj.Size.X + e_s
  1127.         end
  1128.     elseif f == 'Top' or f == 'Bottom' then
  1129.         texture.StudsPerTileV = obj.Size.X + e_s
  1130.         texture.StudsPerTileU = obj.Size.Z + e_s
  1131.     end
  1132.     --end)
  1133. end
  1134.  
  1135. function add_blood(obj)
  1136.     local t1,t2,t3,t4,t5,t6 = blood_images[math.random(1,#blood_images)],blood_images[math.random(1,#blood_images)],blood_images[math.random(1,#blood_images)],blood_images[math.random(1,#blood_images)],blood_images[math.random(1,#blood_images)],blood_images[math.random(1,#blood_images)]
  1137.     add_decal('Top',t1,obj)
  1138.     add_decal('Bottom',t2,obj)
  1139.     add_decal('Left',t3,obj)
  1140.     add_decal('Right',t4,obj)
  1141.     add_decal('Front',t5,obj)
  1142.     add_decal('Back',t6,obj)
  1143. end
  1144.  
  1145. function make_bone(obj,targtorso)
  1146.     if obj.Name == 'Left Arm' or obj.Name == 'LeftUpperArm' then
  1147.         local bone = Instance.new("Part")
  1148.         bone.name = 'bone'
  1149.         bone.CanCollide = false
  1150.         bone.Anchored = false
  1151.         bone.CFrame = targtorso.CFrame
  1152.         bone.Size = targtorso.Size
  1153.         bone.Massless = true
  1154.         bone.Locked = true
  1155.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1156.         if not exists then
  1157.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1158.         end
  1159.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1160.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1161.         game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  1162.         local weld = Instance.new("Weld")
  1163.         weld.Part0 = bone
  1164.         weld.Part1 = targtorso
  1165.         weld.C1 = CFrame.new(-0.61,0.77,0.03)*CFrame.Angles(math.rad(90),0,math.rad(90))
  1166.         weld.Parent = bone
  1167.         targtorso.Anchored = false
  1168.         bone.Parent = script
  1169.         local mesh = Instance.new("SpecialMesh")
  1170.         mesh.MeshId = 'rbxassetid://1076136382'
  1171.         mesh.TextureId = 'rbxassetid://1076137938'
  1172.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1173.         mesh.Parent = bone
  1174.         --
  1175.         local bone = Instance.new("Part")
  1176.         bone.Name = 'bone'
  1177.         bone.CanCollide = false
  1178.         bone.Anchored = false
  1179.         bone.CFrame = obj.CFrame
  1180.         bone.Size = obj.Size
  1181.         bone.Massless = true
  1182.         bone.Locked = true
  1183.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1184.         if not exists then
  1185.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1186.         end
  1187.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1188.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1189.         game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1190.         local weld = Instance.new("Weld")
  1191.         weld.Part0 = bone
  1192.         weld.Part1 = obj
  1193.         weld.C1 = CFrame.new(0.13,0.26,0)
  1194.         weld.Parent = bone
  1195.         obj.Anchored = false
  1196.         bone.Parent = script
  1197.         local mesh = Instance.new("SpecialMesh")
  1198.         mesh.MeshId = 'rbxassetid://36780032'
  1199.         mesh.TextureId = 'rbxassetid://36780292'
  1200.         mesh.Parent = bone
  1201.     elseif obj.Name == 'Right Arm' or obj.Name == 'RightUpperArm' then
  1202.         local bone = Instance.new("Part")
  1203.         bone.Name = 'bone'
  1204.         bone.CanCollide = false
  1205.         bone.Anchored = false
  1206.         bone.CFrame = targtorso.CFrame
  1207.         bone.Size = targtorso.Size
  1208.         bone.Massless = true
  1209.         bone.Locked = true
  1210.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1211.         if not exists then
  1212.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1213.         end
  1214.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1215.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1216.         game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  1217.         local weld = Instance.new("Weld")
  1218.         weld.Part0 = bone
  1219.         weld.Part1 = targtorso
  1220.         weld.C1 = CFrame.new(0.61,0.77,0.03)*CFrame.Angles(math.rad(90),0,math.rad(-90))
  1221.         weld.Parent = bone
  1222.         targtorso.Anchored = false
  1223.         bone.Parent = script
  1224.         local mesh = Instance.new("SpecialMesh")
  1225.         mesh.MeshId = 'rbxassetid://1076136382'
  1226.         mesh.TextureId = 'rbxassetid://1076137938'
  1227.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1228.         mesh.Parent = bone
  1229.         --
  1230.         local bone = Instance.new("Part")
  1231.         bone.Name = 'bone'
  1232.         bone.CanCollide = false
  1233.         bone.Anchored = false
  1234.         bone.CFrame = obj.CFrame
  1235.         bone.Size = obj.Size
  1236.         bone.Massless = true
  1237.         bone.Locked = true
  1238.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1239.         if not exists then
  1240.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1241.         end
  1242.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1243.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1244.         game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1245.         local weld = Instance.new("Weld")
  1246.         weld.Part0 = bone
  1247.         weld.Part1 = obj
  1248.         weld.C1 = CFrame.new(-0.13,0.26,0)
  1249.         weld.Parent = bone
  1250.         obj.Anchored = false
  1251.         bone.Parent = script
  1252.         local mesh = Instance.new("SpecialMesh")
  1253.         mesh.MeshId = 'rbxassetid://36780156'
  1254.         mesh.TextureId = 'rbxassetid://36780292'
  1255.         mesh.Parent = bone
  1256.     elseif obj.Name == 'Left Leg' or obj.Name == 'LeftUpperLeg' then
  1257.         local bone = Instance.new("Part")
  1258.         bone.Name = 'bone'
  1259.         bone.CanCollide = false
  1260.         bone.Anchored = false
  1261.         bone.CFrame = targtorso.CFrame
  1262.         bone.Size = targtorso.Size
  1263.         bone.Massless = true
  1264.         bone.Locked = true
  1265.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1266.         if not exists then
  1267.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1268.         end
  1269.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1270.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1271.         game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  1272.         local weld = Instance.new("Weld")
  1273.         weld.Part0 = bone
  1274.         weld.Part1 = targtorso
  1275.         weld.C1 = CFrame.new(-0.6,-0.64,0.11)*CFrame.Angles(0,0,math.rad(180))
  1276.         weld.Parent = bone
  1277.         targtorso.Anchored = false
  1278.         bone.Parent = script
  1279.         local mesh = Instance.new("SpecialMesh")
  1280.         mesh.MeshId = 'rbxassetid://1076136382'
  1281.         mesh.TextureId = 'rbxassetid://1076137938'
  1282.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1283.         mesh.Parent = bone
  1284.         --
  1285.         local bone = Instance.new("Part")
  1286.         bone.Name = 'bone'
  1287.         bone.CanCollide = false
  1288.         bone.Anchored = false
  1289.         bone.CFrame = obj.CFrame
  1290.         bone.Size = obj.Size
  1291.         bone.Massless = true
  1292.         bone.Locked = true
  1293.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1294.         if not exists then
  1295.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1296.         end
  1297.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1298.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1299.         game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1300.         local weld = Instance.new("Weld")
  1301.         weld.Part0 = bone
  1302.         weld.Part1 = obj
  1303.         weld.C1 = CFrame.new(0,0.09,0.13)
  1304.         weld.Parent = bone
  1305.         obj.Anchored = false
  1306.         bone.Parent = script
  1307.         local mesh = Instance.new("SpecialMesh")
  1308.         mesh.MeshId = 'rbxassetid://36780156'
  1309.         mesh.TextureId = 'rbxassetid://36780292'
  1310.         mesh.Parent = bone
  1311.     elseif obj.Name == 'Right Leg' or obj.Name == 'RightUpperLeg' then
  1312.         local bone = Instance.new("Part")
  1313.         bone.Name = 'bone'
  1314.         bone.CanCollide = false
  1315.         bone.Anchored = false
  1316.         bone.CFrame = targtorso.CFrame
  1317.         bone.Size = targtorso.Size
  1318.         bone.Massless = true
  1319.         bone.Locked = true
  1320.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1321.         if not exists then
  1322.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1323.         end
  1324.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1325.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1326.         game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  1327.         local weld = Instance.new("Weld")
  1328.         weld.Part0 = bone
  1329.         weld.Part1 = targtorso
  1330.         weld.C1 = CFrame.new(0.6,-0.64,0.11)*CFrame.Angles(0,0,math.rad(180))
  1331.         weld.Parent = bone
  1332.         targtorso.Anchored = false
  1333.         bone.Parent = script
  1334.         local mesh = Instance.new("SpecialMesh")
  1335.         mesh.MeshId = 'rbxassetid://1076136382'
  1336.         mesh.TextureId = 'rbxassetid://1076137938'
  1337.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1338.         mesh.Parent = bone
  1339.         --
  1340.         local bone = Instance.new("Part")
  1341.         bone.Name = 'bone'
  1342.         bone.CanCollide = false
  1343.         bone.Anchored = false
  1344.         bone.CFrame = obj.CFrame
  1345.         bone.Size = obj.Size
  1346.         bone.Massless = true
  1347.         bone.Locked = true
  1348.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1349.         if not exists then
  1350.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1351.         end
  1352.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1353.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1354.         game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1355.         local weld = Instance.new("Weld")
  1356.         weld.Part0 = bone
  1357.         weld.Part1 = obj
  1358.         weld.C1 = CFrame.new(0,0.09,0.13)
  1359.         weld.Parent = bone
  1360.         obj.Anchored = false
  1361.         bone.Parent = script
  1362.         local mesh = Instance.new("SpecialMesh")
  1363.         mesh.MeshId = 'rbxassetid://36780195'
  1364.         mesh.TextureId = 'rbxassetid://36780292'
  1365.         mesh.Parent = bone
  1366.     elseif obj.Name == 'Head' then
  1367.         local bone = Instance.new("Part")
  1368.         bone.Name = 'bone'
  1369.         bone.CanCollide = false
  1370.         bone.Anchored = false
  1371.         bone.CFrame = targtorso.CFrame
  1372.         bone.Size = targtorso.Size
  1373.         bone.Massless = true
  1374.         bone.Locked = true
  1375.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1376.         if not exists then
  1377.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1378.         end
  1379.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1380.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1381.         game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  1382.         local weld = Instance.new("Weld")
  1383.         weld.Part0 = bone
  1384.         weld.Part1 = targtorso
  1385.         weld.C1 = CFrame.new(0,0.66,0)
  1386.         weld.Parent = bone
  1387.         targtorso.Anchored = false
  1388.         bone.Parent = script
  1389.         local mesh = Instance.new("SpecialMesh")
  1390.         mesh.MeshId = 'rbxassetid://1076136382'
  1391.         mesh.TextureId = 'rbxassetid://1076137938'
  1392.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1393.         mesh.Parent = bone
  1394.         --
  1395.         local bone = Instance.new("Part")
  1396.         bone.Name = 'bone'
  1397.         bone.CanCollide = false
  1398.         bone.Anchored = false
  1399.         bone.CFrame = obj.CFrame
  1400.         bone.Size = obj.Size
  1401.         bone.Massless = true
  1402.         bone.Locked = true
  1403.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1404.         if not exists then
  1405.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1406.         end
  1407.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1408.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  1409.         game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1410.         local weld = Instance.new("Weld")
  1411.         weld.Part0 = bone
  1412.         weld.Part1 = obj
  1413.         weld.C1 = CFrame.new(0,-0.23,0)*CFrame.Angles(0,math.rad(-90),0)
  1414.         weld.Parent = bone
  1415.         obj.Anchored = false
  1416.         bone.Parent = script
  1417.         local mesh = Instance.new("SpecialMesh")
  1418.         mesh.MeshId = 'rbxassetid://1076136382'
  1419.         mesh.TextureId = 'rbxassetid://1076137938'
  1420.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  1421.         mesh.Parent = bone
  1422.     end
  1423. end
  1424.  
  1425. function break_limb(obj,rig,targtorso,targhum)
  1426.     if not obj:FindFirstChild('Dismembered') and obj.Name ~= 'Torso' and obj.Name ~= 'HumanoidRootPart' and obj.Name ~= 'UpperTorso' and obj.Name ~= 'LowerTorso' then else return end
  1427.     local confirm = Instance.new("ObjectValue")
  1428.     confirm.Name = 'Dismembered'
  1429.     confirm.Parent = obj
  1430.     local bsc = obj:FindFirstChildOfClass("BallSocketConstraint")
  1431.     if bsc then
  1432.         bsc:Destroy()
  1433.     end
  1434.     --bleed2(obj,targhum,false,5,false)
  1435.     add_blood(obj)
  1436.     make_bone(obj,targtorso)
  1437.     local kb = 15
  1438.     local bv = Instance.new("BodyVelocity")
  1439.     bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  1440.     bv.Velocity = han.CFrame.lookVector*kb+Vector3.new(0,kb,0)
  1441.     bv.Parent = obj
  1442.     game:GetService("Debris"):AddItem(bv,0.1)
  1443.     if rig == Enum.HumanoidRigType.R6 then
  1444.         local bsc = obj:FindFirstChildOfClass("BallSocketConstraint")
  1445.         if bsc then
  1446.             bsc:Destroy()
  1447.         end
  1448.         for i,v in pairs(targtorso:GetChildren()) do
  1449.             if v:IsA("Motor6D") then
  1450.                 if obj.Name == 'Head' and v.Name == 'Neck' then
  1451.                     v:Destroy()
  1452.                 elseif obj.Name == 'Left Arm' and v.Name == 'Left Shouldver' then
  1453.                     v:Destroy()
  1454.                 elseif obj.Name == 'Right Arm' and v.Name == 'Right Shoulder' then
  1455.                     v:Destroy()
  1456.                 elseif obj.Name == 'Left Leg' and v.Name == 'Left Hip' then
  1457.                     if obj.Parent:FindFirstChild("Right Leg") then
  1458.                         targhum.WalkSpeed = targhum.WalkSpeed/2
  1459.                     else
  1460.                         targhum.WalkSpeed = 0
  1461.                     end
  1462.                     v:Destroy()
  1463.                 elseif obj.Name == 'Right Leg' and v.Name == 'Right Hip' then
  1464.                     if obj.Parent:FindFirstChild("Left Leg") then
  1465.                         targhum.WalkSpeed = targhum.WalkSpeed/2
  1466.                     else
  1467.                         targhum.WalkSpeed = 0
  1468.                     end
  1469.                     v:Destroy()
  1470.                 end
  1471.             end
  1472.         end
  1473.     elseif rig == Enum.HumanoidRigType.R15 then
  1474.         for i,v in pairs(obj:GetChildren()) do
  1475.             if v:IsA("Motor6D") then
  1476.                 if (obj.Name == 'LeftUpperLeg' and obj.Parent:FindFirstChild("RightUpperLeg")) or (obj.Name == 'RightUpperLeg' and obj.Parent:FindFirstChild("LeftUpperLeg")) then
  1477.                     targhum.WalkSpeed = targhum.WalkSpeed/2
  1478.                 elseif obj.Name == 'RightUpperLeg' or obj.Name == 'LeftUpperLeg' then
  1479.                     targhum.WalkSpeed = 0
  1480.                 end
  1481.                 v:Destroy()
  1482.             end
  1483.         end
  1484.     end
  1485.     local cb = Instance.new("Part")
  1486.     cb.Name = 'limb'
  1487.     cb.Transparency = 1
  1488.     cb.CanCollide = true
  1489.     cb.Anchored = false
  1490.     cb.CFrame = obj.CFrame
  1491.     cb.Size = obj.Size
  1492.     cb.Massless = true
  1493.     cb.Locked = true
  1494.     local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  1495.     if not exists then
  1496.         game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  1497.     end
  1498.     game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  1499.     game:GetService("PhysicsService"):SetPartCollisionGroup(cb,'Limb Collide')
  1500.     game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  1501.     local weld = Instance.new("Weld")
  1502.     weld.Part0 = cb
  1503.     weld.Part1 = obj
  1504.     weld.Parent = cb
  1505.     obj.Massless = true
  1506.     obj.Anchored = false
  1507.     cb.Parent = script
  1508. end
  1509.  
  1510. function check(toughness,obj,objpos,p,rays,rot)
  1511.     local plrhit = false
  1512.     if obj and not obj:FindFirstChild('Dismembered') then else return; end;
  1513.     local targchar,targtorso,targhum,targhead
  1514.     pcall(function()
  1515.         targchar = obj.Parent
  1516.     end)
  1517.     for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  1518.         if v and v.Character and obj:IsDescendantOf(v.Character) then
  1519.             targchar = v.Character
  1520.         end
  1521.     end
  1522.     pcall(function()
  1523.         targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("HumanoidRootPart")
  1524.     end)
  1525.     pcall(function()
  1526.         targhum = targchar:FindFirstChildOfClass("Humanoid")
  1527.     end)
  1528.     pcall(function()
  1529.         targhead = targchar:FindFirstChild("Head")
  1530.     end)
  1531.     if targchar and targchar.Parent and targtorso and targtorso.Parent and targhum and targhum.Parent and targhum ~= hum and targhead and targhead.Parent and not targhum:FindFirstChild("hit " .. targchar.Name .. " with " .. gun.Name .. " by " .. plr.Name) then
  1532.         plrhit = true
  1533.         local confirm = Instance.new("IntValue")
  1534.         confirm.Parent = targhum
  1535.         confirm.Name = ("hit " .. targchar.Name .. " with " .. gun.Name .. " by " .. plr.Name)
  1536.         debris:AddItem(confirm,shootwait)
  1537.         local dmg = math.random(40,50)
  1538.         if obj == targhead then
  1539.             dmg = math.random(60,80)
  1540.             targhum:TakeDamage(dmg)
  1541.         elseif not op then
  1542.             dmg = math.random(20,40)
  1543.             targhum:TakeDamage(dmg)
  1544.         elseif op then
  1545.             targhum.MaxHealth = 0
  1546.             targhum.Health = 0
  1547.             targhum.Parent:BreakJoints()
  1548.         end
  1549.         if math.random(1,4) == 1 then
  1550.             break_limb(obj,targhum.RigType,targtorso,targhum)
  1551.         end
  1552.         add_blood(obj)
  1553.         --[[
  1554.         local bleeding = Instance.new("Sound")
  1555.         bleeding.SoundId = 'rbxassetid://360007673'
  1556.         bleeding.Volume = 1
  1557.         bleeding.Parent = targtorso
  1558.         bleeding:Play()
  1559.         ]]
  1560.         remote:FireClient(plr,1,'rbxassetid://360007673',nil,1,targtorso)
  1561.         if 0 >= targhum.Health and obj == targhead then
  1562.             kill(obj,true,p.CFrame.lookVector)
  1563.         elseif 0 >= targhum.Health then
  1564.             kill(obj,false,p.CFrame.lookVector)
  1565.         elseif targhum.Health > 0 then
  1566.             --bleed2(targtorso,targhum,true,5,false)
  1567.         end
  1568.     else
  1569.         table.insert(objhit,1,obj)
  1570.         local mat = obj.Material
  1571.         local mathit = obj:FindFirstChild('material hit ' .. plr.Name)
  1572.         if not mathit and toughness > 0 and 1 > obj.Transparency then
  1573.             --print('old: ' .. toughness)
  1574.             if (mat == Enum.Material.Glass or mat == Enum.Material.Ice) then
  1575.                 breakwindow(obj)
  1576.             elseif (mat == Enum.Material.Wood or mat == Enum.Material.WoodPlanks) then
  1577.                 toughness = toughness - 1.5
  1578.             elseif (mat == Enum.Material.Metal or mat == Enum.Material.DiamondPlate or mat == Enum.Material.CorrodedMetal) then
  1579.                 toughness = toughness - 5
  1580.             elseif (mat == Enum.Material.Brick or mat == Enum.Material.Concrete or mat == Enum.Material.Cobblestone or mat == Enum.Material.Granite or mat == Enum.Material.Slate or mat == Enum.Material.Pebble) then
  1581.                 toughness = toughness - 3
  1582.             else
  1583.                 toughness = toughness - 1
  1584.             end
  1585.             --print('new: ' .. toughness)
  1586.             local libruary = {
  1587.                 ['wizz'] = {342190005, 342190012, 342190017, 342190024},
  1588.                 ['crackSmall'] = {873119768, 873119788, 873119811, 873119845, 873119886, 873119904},
  1589.                 ['crackBig'] = {873119597, 873119653, 873119679, 873119703, 873119724, 873119744},
  1590.                 ['whizz'] = {873121840, 873121858, 873121876, 873121896, 873121913, 873121936},
  1591.                 ['woodhit'] = {342204157, 342204164, 342204170, 342204175, 871705143, 871705174}, --871705195, 871705217, 871705237, 871705264
  1592.                 ['stonehit'] = {871701076, 871701134, 871701190, 871701241, 871701297, 871701346},
  1593.                 ['metalhit'] = {871704182, 871704259, 871704297, 871704329, 871704362, 871704395},
  1594.                 ['grasshit'] = {871709869, 871709832, 871709789, 871709755, 871709708, 871709643},
  1595.                 ['impact'] = {525720625},
  1596.             }
  1597.             local soundfont=({
  1598.                 Brick="stonehit";
  1599.                 Cobblestone="stonehit";
  1600.                 Concrete="stonehit";
  1601.                 CorrodedMetal="metalhit";
  1602.                 DiamondPlate="metalhit";
  1603.                 Fabric=nil;
  1604.                 Foil="metalhit";
  1605.                 Granite="stonehit";
  1606.                 Grass="grasshit";
  1607.                 Ice="stonehit";
  1608.                 Marble="stonehit";
  1609.                 Metal="metalhit";
  1610.                 Neon=nil;
  1611.                 Pebble="stonehit";
  1612.                 Plastic="metalhit";
  1613.                 Sand=nil;
  1614.                 Slate="stonehit";
  1615.                 SmoothPlastic="metalhit";
  1616.                 Wood="woodhit";
  1617.                 WoodPlanks="woodhit";
  1618.             })[mat.Name]
  1619.             local part = make_hole(CFrame.new(objpos, objpos - rot) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)) * CFrame.Angles(math.rad(0), math.rad(math.random(-360, 360)), math.rad(0)), obj, obj.BrickColor)
  1620.             --[[
  1621.             local BulletHoleSound = Instance.new("Sound")
  1622.             BulletHoleSound.Volume = 3
  1623.             BulletHoleSound.Pitch = math.random(9,11)/10
  1624.             ]]
  1625.             local _id = ''
  1626.             if soundfont ~= nil then
  1627.                 --[[BulletHoleSound.SoundId]]_id = "rbxassetid://"..libruary[soundfont][math.random(1,6)]
  1628.             else
  1629.                 --[[BulletHoleSound.SoundId]]_id = "rbxassetid://"..libruary['impact'][1]
  1630.             end
  1631.             --BulletHoleSound.Parent = part
  1632.             --BulletHoleSound:Play()
  1633.             remote:FireClient(plr,1,_id,nil,3,part)
  1634.             local tempmathit = Instance.new("ObjectValue")
  1635.             tempmathit.Name = ('material hit ' .. plr.Name)
  1636.             tempmathit.Parent = obj
  1637.             game:GetService("Debris"):AddItem(tempmathit,shootwait/bulletfire)
  1638.             game:GetService("Debris"):AddItem(part,7)
  1639.         end
  1640.     end
  1641.     if toughness > 0 and rays > 0 then
  1642.         local found = false
  1643.         for i,v in pairs(oldobjhit) do if v and obj:IsDescendantOf(v) then found = true; end; end;
  1644.         oldobjhit = objhit
  1645.         if not plrhit and not found then
  1646.             rays = rays - 1
  1647.             wait()
  1648.         end
  1649.         local ig = {char,gun,script,unpack(objhit)}
  1650.         local _obj,_vec,_rot = raycast(objpos,(hitpos-han.Position).Unit, nil, ig) -- (hitpos-objpos).Unit
  1651.         check(toughness,_obj,_vec,p,rays,_rot)
  1652.     else
  1653.         p:Destroy()
  1654.     end
  1655. end
  1656.  
  1657. function drop_shell()
  1658.     local Shell = Instance.new("Part")
  1659.     Shell.Color = Color3.new(1, 1, 0)
  1660.     Shell.Size = Vector3.new(0.530001819, 0.132500455, 0.132500455)
  1661.     Shell.BottomSurface = Enum.SurfaceType.Smooth
  1662.     Shell.BrickColor = BrickColor.new("New Yeller")
  1663.     Shell.Material = Enum.Material.Metal
  1664.     Shell.Shape = Enum.PartType.Cylinder
  1665.     Shell.CFrame = han.CFrame
  1666.     Shell.Parent = script
  1667.     local bvs = Instance.new("BodyVelocity")
  1668.     bvs.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  1669.     bvs.Velocity = han.CFrame.lookVector+Vector3.new(0,10,-5)
  1670.     bvs.Parent = Shell
  1671.     game:GetService("Debris"):AddItem(bvs,0.1)
  1672.     game:GetService("Debris"):AddItem(Shell,10)
  1673. end
  1674.  
  1675. function Shoot()
  1676.     if not using and CheckIfAlive() and ammo > 0 then
  1677.         using = true
  1678.         wait()
  1679.         tween:Create(gun,TweenInfo.new(0.1),({Grip = CFrame.new(0.620260894, -0.0916732326, -0.0302125812, -9.87688793e-08, -0.110220745, 0.993907273, -1.070606e-08, 0.993907213, 0.110220768, -1, 2.45549053e-10, -9.93471261e-08)})):Play()
  1680.         spawn(function()
  1681.             flash.Enabled = true
  1682.             light.Enabled = true
  1683.             smoke.Enabled = true
  1684.             wait()
  1685.             flash.Enabled = false
  1686.             light.Enabled = false
  1687.             smoke.Enabled = false
  1688.         end)
  1689.         spawn(function()
  1690.             for i = 1,bulletfire do
  1691.                 ammo = ammo - 1
  1692.                 drop_shell()
  1693.                 --shoot_s.SoundId = 'rbxassetid://' .. sh[math.random(1,#shots)]
  1694.                 shoot_s:Play()
  1695.                 for i,v in ipairs(objhit) do table.remove(objhit,i); end;
  1696.                 for i,v in ipairs(objhit) do table.remove(oldobjhit,i); end;
  1697.                 spawn(function()
  1698.                     local p = Instance.new("Part")
  1699.                     p.Name = "bullet"
  1700.                     p.Massless = true
  1701.                     p.Anchored = false
  1702.                     p.CanCollide = false
  1703.                     p.Color = Color3.fromRGB(255, 255, 0)
  1704.                     p.Size = Vector3.new(0.5,0.5,1)
  1705.                     p.Transparency = 0
  1706.                     p.Position = han.Position
  1707.                     p.CFrame = CFrame.new(han.Position,hitpos)
  1708.                     p.Velocity = p.CFrame.lookVector * 2000
  1709.                     p.Material = Enum.Material.Neon
  1710.                     p.Parent = script
  1711.                     local mesh = Instance.new("SpecialMesh")
  1712.                     mesh.MeshType = Enum.MeshType.Sphere
  1713.                     mesh.Parent = p
  1714.                     --tween:Create(p,TweenInfo.new(((hitpos)-han.Position).Magnitude/10000),{Position = p.Position + ((hitpos)-han.Position).Unit*1000}):Play()
  1715.                     local body_vel = Instance.new("BodyVelocity")
  1716.                     body_vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  1717.                     body_vel.Velocity = p.CFrame.lookVector * 2000
  1718.                     body_vel.Parent = p
  1719.                     debris:AddItem(p,3)
  1720.                     game:GetService("TweenService"):Create(p,TweenInfo.new(3),{Size = Vector3.new(0.5,0.5,10),Transparency = 1}):Play()
  1721.                     local toughness = 3
  1722.                     local rays = 5
  1723.                     local ig = {char,gun,script}
  1724.                     local obj,vec,rot = raycast(han.Position,(hitpos-han.Position).Unit, nil, ig)
  1725.                     check(toughness,obj,vec,p,rays,rot)
  1726.                 end)
  1727.                 remote:FireClient(plr,1,shoot_s.SoundId,shoot_s,5,han)
  1728.                 wait(shootwait/bulletfire)
  1729.             end
  1730.         end)
  1731.         spawn(function()
  1732.             wait(0.1)
  1733.             tween:Create(gun,TweenInfo.new(0.1),({Grip = CFrame.new(0.660811424, -0.0547437184, -0.0302125812, -9.93472327e-08, -0.00441347063, 0.999990404, -1.92918556e-10, 0.999990284, 0.00441347761, -1, 2.45549053e-10, -9.93471261e-08)})):Play()
  1734.         end)
  1735.         wait(shootwait)
  1736.         using = false
  1737.     end
  1738. end
  1739.  
  1740. gun.Activated:Connect(function()
  1741.     if not using and CheckIfAlive() and 0 >= ammo then
  1742.         Reload()
  1743.     end
  1744. end)
  1745.  
  1746. gun.Equipped:Connect(function()
  1747.     equipped = true
  1748.     pcall(function()
  1749.         char = gun.Parent
  1750.         plr = game:GetService("Players"):GetPlayerFromCharacter(char)
  1751.         hum = char:FindFirstChildOfClass("Humanoid")
  1752.         torso = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso")
  1753.         rootpart = char:FindFirstChild("HumanoidRootPart")
  1754.         if not CheckIfAlive() then gun.Parent = nil return end
  1755.     end)
  1756. end)
  1757.  
  1758. gun.Unequipped:Connect(function()
  1759.     equipped = false
  1760. end)
  1761.  
  1762. remote = Instance.new("RemoteEvent")
  1763. remote.Name = 'mp40_remote'
  1764. remote.Parent = gun
  1765.  
  1766. remote.OnServerEvent:Connect(function(player,mode,data,data2)
  1767.     if equipped then else return end
  1768.     if plr == player and mode == 1 then
  1769.         if data ~= nil then
  1770.             hitpos = data
  1771.         end
  1772.         if data2 ~= nil then
  1773.             shooting = data2
  1774.         end
  1775.         if shooting then
  1776.             Shoot()
  1777.         end
  1778.     elseif not shooting and not using and CheckIfAlive() and plr == player and mode == 2 and data == 'reload' then
  1779.         Reload()
  1780.     end
  1781. end)
  1782.  
  1783. local ls = [[
  1784.     local plr = game:GetService("Players").LocalPlayer
  1785.     local mouse = plr:GetMouse()
  1786.     local char = plr.Character
  1787.     local remote = script.Parent
  1788.     local tool = remote.Parent
  1789.     local shooting = false
  1790.     local lh = Vector3.new()
  1791.     tool.Equipped:Connect(function()
  1792.         pcall(function()
  1793.             char = tool.Parent
  1794.         end)
  1795.         pcall(function()
  1796.             plr = game:GetService("Players"):GetPlayerFromCharacter(char)
  1797.         end)
  1798.         pcall(function()
  1799.             mouse = plr:GetMouse()
  1800.         end)
  1801.         if mouse then
  1802.             mouse.KeyDown:Connect(function(key)
  1803.                 if key == 'r' then
  1804.                     remote:FireServer(2,'reload')
  1805.                 end
  1806.             end)
  1807.             mouse.Button1Down:Connect(function()
  1808.                 shooting = true
  1809.                 while shooting do
  1810.                     local pos
  1811.                     if mouse.Hit then
  1812.                         pos = mouse.Hit.Position
  1813.                     end
  1814.                     lh = pos or Vector3.new()
  1815.                     remote:FireServer(1,pos,true)
  1816.                     wait(0.045)
  1817.                 end
  1818.                 remote:FireServer(1,lh,false)
  1819.             end)
  1820.             mouse.Button1Up:Connect(function()
  1821.                 shooting = false
  1822.             end)
  1823.         end
  1824.     end)
  1825.     remote.OnClientEvent:Connect(function(mode,data,inst,v,p)
  1826.         if mode == 1 then
  1827.             if inst then inst.Volume = 0; end;
  1828.             local sound = Instance.new("Sound")
  1829.             sound.SoundId = data
  1830.             sound.Volume = v
  1831.             sound.Parent = p
  1832.             sound:Play()
  1833.         elseif mode == 2 then
  1834.             --if inst then inst.Transparency = 1; end;
  1835.             local decal = Instance.new("Decal")
  1836.             decal.Texture = data
  1837.             decal.Transparency = v
  1838.             decal.Parent = p
  1839.             decal.Face = inst
  1840.         end
  1841.     end)
  1842. ]]
  1843.  
  1844. NLS(ls,remote)
Add Comment
Please, Sign In to add comment