KrYn0MoRe

stg-44

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