KrYn0MoRe

scar-h

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