Advertisement
KrYn0MoRe

gun serverside + server remote

Nov 26th, 2020 (edited)
1,344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 37.39 KB | None | 0 0
  1. local server_remote = game:GetService("ReplicatedStorage"):FindFirstChild('gun_server_remote') or Instance.new('RemoteEvent',game:GetService("ReplicatedStorage"))
  2. local gundata = {
  3.     ['AK-47'] = {
  4.         reload_s = 'rbxassetid://3742928054',
  5.         shoot_s = 'rbxassetid://168436671',
  6.     },
  7.     ['M4A1-S'] = {
  8.         reload_s = 'rbxassetid://2232695010',
  9.         shoot_s = 'rbxassetid://4642718673',
  10.     },
  11.     ['G18'] = {
  12.         reload_s = 'rbxassetid://2232697419',
  13.         shoot_s = 'rbxassetid://240718012',
  14.     },
  15.     ['BFG-50'] = {
  16.         reload_s = 'rbxassetid://2775805505',
  17.         shoot_s = 'rbxassetid://590136707',
  18.     },
  19.     ['SSG-08'] = {
  20.         reload_s = 'rbxassetid://4649193317',
  21.         shoot_s = 'rbxassetid://4649186576',
  22.     },
  23. }
  24. local junk = workspace:WaitForChild('junk',1) or Instance.new("Folder",workspace)
  25. junk.Name = 'junk'
  26.  
  27. function alive(c)
  28.     if c and c:FindFirstChildOfClass("Humanoid") and c:FindFirstChildOfClass("Humanoid").Health > 0 and (c:FindFirstChild("HumanoidRootPart") or c:FindFirstChild("Torso")) and c:FindFirstChild("Head") then
  29.         return true
  30.     end
  31.     return false
  32. end
  33.  
  34. function exists(c)
  35.     if c and c:FindFirstChildOfClass("Humanoid") and (c:FindFirstChild("HumanoidRootPart") or c:FindFirstChild("Torso")) and c:FindFirstChild("Head") then
  36.         return true
  37.     end
  38.     return false
  39. end
  40.  
  41. function make_bone(obj,targtorso)
  42.     if obj.Name == 'Left Arm' or obj.Name == 'LeftUpperArm' then
  43.         local bone = Instance.new("Part")
  44.         bone.Name = 'bone'
  45.         bone.CanCollide = false
  46.         bone.Anchored = false
  47.         bone.CFrame = targtorso.CFrame
  48.         bone.Size = targtorso.Size
  49.         bone.Massless = true
  50.         bone.Locked = true
  51.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  52.         if not exists then
  53.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  54.         end
  55.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  56.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  57.         game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  58.         local weld = Instance.new("Weld")
  59.         weld.Part0 = bone
  60.         weld.Part1 = targtorso
  61.         weld.C1 = CFrame.new(-0.61,0.77,0.03)*CFrame.Angles(math.rad(90),0,math.rad(90))
  62.         weld.Parent = bone
  63.         targtorso.Anchored = false
  64.         bone.Parent = junk
  65.         local mesh = Instance.new("SpecialMesh")
  66.         mesh.MeshId = 'rbxassetid://1076136382'
  67.         mesh.TextureId = 'rbxassetid://1076137938'
  68.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  69.         mesh.Parent = bone
  70.         --
  71.         local bone = Instance.new("Part")
  72.         bone.Name = 'bone'
  73.         bone.CanCollide = false
  74.         bone.Anchored = false
  75.         bone.CFrame = obj.CFrame
  76.         bone.Size = obj.Size
  77.         bone.Massless = true
  78.         bone.Locked = true
  79.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  80.         if not exists then
  81.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  82.         end
  83.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  84.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  85.         game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  86.         local weld = Instance.new("Weld")
  87.         weld.Part0 = bone
  88.         weld.Part1 = obj
  89.         weld.C1 = CFrame.new(0.13,0.26,0)
  90.         weld.Parent = bone
  91.         obj.Anchored = false
  92.         bone.Parent = junk
  93.         local mesh = Instance.new("SpecialMesh")
  94.         mesh.MeshId = 'rbxassetid://36780032'
  95.         mesh.TextureId = 'rbxassetid://36780292'
  96.         mesh.Parent = bone
  97.     elseif obj.Name == 'Right Arm' or obj.Name == 'RightUpperArm' then
  98.         local bone = Instance.new("Part")
  99.         bone.Name = 'bone'
  100.         bone.CanCollide = false
  101.         bone.Anchored = false
  102.         bone.CFrame = targtorso.CFrame
  103.         bone.Size = targtorso.Size
  104.         bone.Massless = true
  105.         bone.Locked = true
  106.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  107.         if not exists then
  108.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  109.         end
  110.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  111.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  112.         game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  113.         local weld = Instance.new("Weld")
  114.         weld.Part0 = bone
  115.         weld.Part1 = targtorso
  116.         weld.C1 = CFrame.new(0.61,0.77,0.03)*CFrame.Angles(math.rad(90),0,math.rad(-90))
  117.         weld.Parent = bone
  118.         targtorso.Anchored = false
  119.         bone.Parent = junk
  120.         local mesh = Instance.new("SpecialMesh")
  121.         mesh.MeshId = 'rbxassetid://1076136382'
  122.         mesh.TextureId = 'rbxassetid://1076137938'
  123.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  124.         mesh.Parent = bone
  125.         --
  126.         local bone = Instance.new("Part")
  127.         bone.Name = 'bone'
  128.         bone.CanCollide = false
  129.         bone.Anchored = false
  130.         bone.CFrame = obj.CFrame
  131.         bone.Size = obj.Size
  132.         bone.Massless = true
  133.         bone.Locked = true
  134.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  135.         if not exists then
  136.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  137.         end
  138.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  139.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  140.         game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  141.         local weld = Instance.new("Weld")
  142.         weld.Part0 = bone
  143.         weld.Part1 = obj
  144.         weld.C1 = CFrame.new(-0.13,0.26,0)
  145.         weld.Parent = bone
  146.         obj.Anchored = false
  147.         bone.Parent = junk
  148.         local mesh = Instance.new("SpecialMesh")
  149.         mesh.MeshId = 'rbxassetid://36780156'
  150.         mesh.TextureId = 'rbxassetid://36780292'
  151.         mesh.Parent = bone
  152.     elseif obj.Name == 'Left Leg' or obj.Name == 'LeftUpperLeg' then
  153.         local bone = Instance.new("Part")
  154.         bone.Name = 'bone'
  155.         bone.CanCollide = false
  156.         bone.Anchored = false
  157.         bone.CFrame = targtorso.CFrame
  158.         bone.Size = targtorso.Size
  159.         bone.Massless = true
  160.         bone.Locked = true
  161.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  162.         if not exists then
  163.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  164.         end
  165.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  166.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  167.         game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  168.         local weld = Instance.new("Weld")
  169.         weld.Part0 = bone
  170.         weld.Part1 = targtorso
  171.         weld.C1 = CFrame.new(-0.6,-0.64,0.11)*CFrame.Angles(0,0,math.rad(180))
  172.         weld.Parent = bone
  173.         targtorso.Anchored = false
  174.         bone.Parent = junk
  175.         local mesh = Instance.new("SpecialMesh")
  176.         mesh.MeshId = 'rbxassetid://1076136382'
  177.         mesh.TextureId = 'rbxassetid://1076137938'
  178.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  179.         mesh.Parent = bone
  180.         --
  181.         local bone = Instance.new("Part")
  182.         bone.Name = 'bone'
  183.         bone.CanCollide = false
  184.         bone.Anchored = false
  185.         bone.CFrame = obj.CFrame
  186.         bone.Size = obj.Size
  187.         bone.Massless = true
  188.         bone.Locked = true
  189.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  190.         if not exists then
  191.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  192.         end
  193.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  194.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  195.         game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  196.         local weld = Instance.new("Weld")
  197.         weld.Part0 = bone
  198.         weld.Part1 = obj
  199.         weld.C1 = CFrame.new(0,0.09,0.13)
  200.         weld.Parent = bone
  201.         obj.Anchored = false
  202.         bone.Parent = junk
  203.         local mesh = Instance.new("SpecialMesh")
  204.         mesh.MeshId = 'rbxassetid://36780156'
  205.         mesh.TextureId = 'rbxassetid://36780292'
  206.         mesh.Parent = bone
  207.     elseif obj.Name == 'Right Leg' or obj.Name == 'RightUpperLeg' then
  208.         local bone = Instance.new("Part")
  209.         bone.Name = 'bone'
  210.         bone.CanCollide = false
  211.         bone.Anchored = false
  212.         bone.CFrame = targtorso.CFrame
  213.         bone.Size = targtorso.Size
  214.         bone.Massless = true
  215.         bone.Locked = true
  216.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  217.         if not exists then
  218.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  219.         end
  220.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  221.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  222.         game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  223.         local weld = Instance.new("Weld")
  224.         weld.Part0 = bone
  225.         weld.Part1 = targtorso
  226.         weld.C1 = CFrame.new(0.6,-0.64,0.11)*CFrame.Angles(0,0,math.rad(180))
  227.         weld.Parent = bone
  228.         targtorso.Anchored = false
  229.         bone.Parent = junk
  230.         local mesh = Instance.new("SpecialMesh")
  231.         mesh.MeshId = 'rbxassetid://1076136382'
  232.         mesh.TextureId = 'rbxassetid://1076137938'
  233.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  234.         mesh.Parent = bone
  235.         --
  236.         local bone = Instance.new("Part")
  237.         bone.Name = 'bone'
  238.         bone.CanCollide = false
  239.         bone.Anchored = false
  240.         bone.CFrame = obj.CFrame
  241.         bone.Size = obj.Size
  242.         bone.Massless = true
  243.         bone.Locked = true
  244.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  245.         if not exists then
  246.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  247.         end
  248.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  249.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  250.         game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  251.         local weld = Instance.new("Weld")
  252.         weld.Part0 = bone
  253.         weld.Part1 = obj
  254.         weld.C1 = CFrame.new(0,0.09,0.13)
  255.         weld.Parent = bone
  256.         obj.Anchored = false
  257.         bone.Parent = junk
  258.         local mesh = Instance.new("SpecialMesh")
  259.         mesh.MeshId = 'rbxassetid://36780195'
  260.         mesh.TextureId = 'rbxassetid://36780292'
  261.         mesh.Parent = bone
  262.     elseif obj.Name == 'Head' then
  263.         local bone = Instance.new("Part")
  264.         bone.Name = 'bone'
  265.         bone.CanCollide = false
  266.         bone.Anchored = false
  267.         bone.CFrame = targtorso.CFrame
  268.         bone.Size = targtorso.Size
  269.         bone.Massless = true
  270.         bone.Locked = true
  271.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  272.         if not exists then
  273.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  274.         end
  275.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  276.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  277.         game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
  278.         local weld = Instance.new("Weld")
  279.         weld.Part0 = bone
  280.         weld.Part1 = targtorso
  281.         weld.C1 = CFrame.new(0,0.66,0)
  282.         weld.Parent = bone
  283.         targtorso.Anchored = false
  284.         bone.Parent = junk
  285.         local mesh = Instance.new("SpecialMesh")
  286.         mesh.MeshId = 'rbxassetid://1076136382'
  287.         mesh.TextureId = 'rbxassetid://1076137938'
  288.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  289.         mesh.Parent = bone
  290.         --
  291.         local bone = Instance.new("Part")
  292.         bone.Name = 'bone'
  293.         bone.CanCollide = false
  294.         bone.Anchored = false
  295.         bone.CFrame = obj.CFrame
  296.         bone.Size = obj.Size
  297.         bone.Massless = true
  298.         bone.Locked = true
  299.         local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  300.         if not exists then
  301.             game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  302.         end
  303.         game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  304.         game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
  305.         game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  306.         local weld = Instance.new("Weld")
  307.         weld.Part0 = bone
  308.         weld.Part1 = obj
  309.         weld.C1 = CFrame.new(0,-0.23,0)*CFrame.Angles(0,math.rad(-90),0)
  310.         weld.Parent = bone
  311.         obj.Anchored = false
  312.         bone.Parent = junk
  313.         local mesh = Instance.new("SpecialMesh")
  314.         mesh.MeshId = 'rbxassetid://1076136382'
  315.         mesh.TextureId = 'rbxassetid://1076137938'
  316.         mesh.Scale = Vector3.new(0.03,0.03,0.03)
  317.         mesh.Parent = bone
  318.     end
  319. end
  320.  
  321. function limb_collide(obj,mode,d)
  322.     if (obj:IsA("UnionOperation") or obj:IsA("BasePart")) and not obj:FindFirstChild('limb') then else return end
  323.     local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
  324.     if not exists then
  325.         game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
  326.     end
  327.     game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
  328.     --
  329.     local t = {}
  330.     --
  331.     local cb = Instance.new("Part")
  332.     cb.Name = 'limb'
  333.     cb.Transparency = 1
  334.     cb.CanCollide = true
  335.     cb.Anchored = false
  336.     cb.CFrame = obj.CFrame
  337.     cb.Size = obj.Size
  338.     cb.Massless = true
  339.     cb.Locked = true
  340.     game:GetService("PhysicsService"):SetPartCollisionGroup(cb,'Limb Collide')
  341.     game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
  342.     local weld = Instance.new("Weld")
  343.     weld.Part0 = cb
  344.     weld.Part1 = obj
  345.     weld.Parent = cb
  346.     obj.Massless = true
  347.     obj.Anchored = false
  348.     if mode or obj:FindFirstChild("Dismembered") then
  349.         cb.Parent = junk -- .Parent
  350.     else
  351.         cb.Parent = junk
  352.         table.insert(t,1,cb)
  353.     end
  354.     if d then
  355.         game:GetService("Debris"):AddItem(cb,d)
  356.     end
  357.     --
  358.     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
  359.         local lv = Vector3.new() -- Vector3.new(cb.Size.X,0,cb.Size.Z)
  360.         local cb2 = Instance.new("Part")
  361.         cb2.Name = 'limb'
  362.         cb2.Transparency = 1
  363.         cb2.CanCollide = true
  364.         cb2.Anchored = false
  365.         cb2.CFrame = obj.CFrame
  366.         cb2.Size = lv
  367.         cb2.Massless = true
  368.         cb2.Locked = true
  369.         --game:GetService("PhysicsService"):SetPartCollisionGroup(cb2,'Limb Collide')
  370.         local weld2 = Instance.new("Weld")
  371.         weld2.Part0 = cb
  372.         weld2.Part1 = cb2
  373.         weld2.C1 = CFrame.new(0,(cb.Size.Y/2),0)
  374.         weld2.Parent = cb2
  375.         if mode or obj:FindFirstChild("Dismembered") then
  376.             cb2.Parent = junk -- .Parent
  377.         else
  378.             cb2.Parent = junk
  379.             table.insert(t,1,cb2)
  380.         end
  381.         if d then
  382.             game:GetService("Debris"):AddItem(cb2,d)
  383.         end
  384.     end
  385.     --
  386.     return t
  387. end
  388.  
  389. function bleed2(plr,frick,targhum,can_hurt,t,splat,dir)
  390.     spawn(function()
  391.         if frick and targhum then else return end
  392.         --[[
  393.         if not frick:FindFirstChild("bleeding from kry's " .. tool.Name) then else return end
  394.         local tempbleedval = Instance.new("ObjectValue")
  395.         tempbleedval.Name = "bleeding from kry's " .. tool.Name
  396.         tempbleedval.Parent = frick
  397.         ]]
  398.         local bleeding = true
  399.         local rig = targhum.RigType
  400.         local limbs = {'Head','Left Arm','Right Arm','Left Leg','Right Leg','RightUpperLeg','LeftUpperLeg','RightUpperArm','LeftUpperArm','RightLowerLeg','LeftLowerLeg','RightLowerArm','LeftLowerArm','RightFoot','LeftFoot','RightHand','LeftHand'}
  401.         spawn(function()
  402.             wait(t)
  403.             bleeding = false
  404.             --tempbleedval:Destroy()
  405.         end)
  406.         while bleeding do
  407.             if (not frick or not frick.Parent or not frick.Parent.Parent or not targhum or not targhum.Parent) then
  408.                 break
  409.             end
  410.             local max_limbs = 0
  411.             local current_limbs = 0
  412.             local gone_limbs = 0
  413.             local targchar = targhum.Parent
  414.             if rig == Enum.HumanoidRigType.R6 then
  415.                 max_limbs = 5
  416.             elseif rig == Enum.HumanoidRigType.R15 then
  417.                 max_limbs = 13
  418.             end
  419.             for i,v in pairs(targchar:GetChildren()) do
  420.                 local found = false
  421.                 for i,n in pairs(limbs) do if n == v.Name then found = true; end; end;
  422.                 if found and not v:FindFirstChild("Dismembered") then
  423.                     current_limbs = current_limbs + 1
  424.                 end
  425.             end
  426.             gone_limbs = (max_limbs-current_limbs)
  427.             if targhum and can_hurt then
  428.                 if gone_limbs >= 1 then
  429.                     if 0 >= (targhum.Health - 0.2*gone_limbs) then
  430.                         targhum.BreakJointsOnDeath = false
  431.                     end
  432.                     targhum:TakeDamage(0.2*gone_limbs)
  433.                 else
  434.                     if 0 >= (targhum.Health - 0.2) then
  435.                         targhum.BreakJointsOnDeath = false
  436.                     end
  437.                     targhum:TakeDamage(0.2)
  438.                 end
  439.                 if 0 >= targhum.Health then
  440.                     kill(plr,targchar,dir,5)
  441.                 end
  442.             end
  443.             spawn(function()
  444.                 local vel = (dir*0.5)+Vector3.new(math.random(-5, 5)/40,math.random(-5, 5)/30,math.random(-5, 5)/40)
  445.                 local thing = Instance.new('Part')
  446.                 thing.Name = "blood_drop"
  447.                 thing.Size = Vector3.new(0.1,0.1,0.1)
  448.                 thing.CFrame = frick.CFrame*CFrame.new(0,frick.Size.Y/2,0)
  449.                 if splat then
  450.                     thing.Transparency = 0
  451.                 elseif not splat then
  452.                     thing.Transparency = 1
  453.                 end
  454.                 thing.Color = Color3.fromRGB(75, 0, 0)
  455.                 thing.Material = Enum.Material.SmoothPlastic
  456.                 thing.CanCollide = false
  457.                 thing.Velocity = vel
  458.                 thing.Parent = junk
  459.                 --thing:SetNetworkOwner(plr)
  460.                 local mesh = Instance.new('SpecialMesh')
  461.                 mesh.MeshType = Enum.MeshType.Sphere
  462.                 mesh.Parent = thing
  463.                 --game:GetService("Debris"):AddItem(thing,5)
  464.                 local att1,att2 = Instance.new("Attachment"),Instance.new("Attachment")
  465.                 att1.Parent = thing
  466.                 att1.Position = Vector3.new(0,-(thing.Size.Y/2),0)
  467.                 att2.Parent = thing
  468.                 att2.Position = Vector3.new(0,(thing.Size.Y/2),0)
  469.                 if splat then
  470.                     local trail_drop = Instance.new("Trail")
  471.                     trail_drop.Parent = thing
  472.                     trail_drop.Attachment0 = att1
  473.                     trail_drop.Attachment1 = att2
  474.                     trail_drop.Color = ColorSequence.new(Color3.new(0.5, 0, 0),Color3.new(0.7, 0, 0))
  475.                     trail_drop.FaceCamera = true
  476.                     trail_drop.LightInfluence = 1
  477.                     trail_drop.WidthScale = NumberSequence.new(1,0)
  478.                     trail_drop.Transparency = NumberSequence.new(0,1)
  479.                     trail_drop.Lifetime = 0.1
  480.                     trail_drop.MinLength = 0
  481.                 end
  482.                 local rawrxd = Instance.new('BodyForce')
  483.                 rawrxd.Parent = thing
  484.                 rawrxd.Force = vel
  485.                 game:GetService("Debris"):AddItem(rawrxd,0.01)
  486.                 thing.Touched:connect(function(tou)
  487.                     if tou and tou.Parent and not tou:IsDescendantOf(targchar) and not tou:IsDescendantOf(junk) and not tou.Parent:FindFirstChildOfClass("Humanoid") and not tou.Parent.Parent:FindFirstChildOfClass("Humanoid") and not tou.Parent:IsA("Accessory") and tou.Name ~= 'Handle' and tou.Parent.Name ~= 'Handle' and not tou.Parent:IsA("Tool") and not string.match(tou.Name:lower(),'blood_drop') and not string.match(tou.Name:lower(),'bullet') and not string.match(tou.Name:lower(),'bone') and not string.match(tou.Name:lower(),'gun mag') and not string.match(tou.Name:lower(),'limb') then
  488.                         local pos = Vector3.new(thing.Position.X,(tou.Position.Y+(tou.Size.Y/2))+(0.02/2),thing.Position.Z)
  489.                         local Point1 = pos-Vector3.new(0.01,0.01,0.01)
  490.                         local Point2 = pos+Vector3.new(0.01,0.01,0.01)
  491.                         local Region = Region3.new(Point1,Point2)
  492.                         for _,Part in pairs(game.Workspace:FindPartsInRegion3(Region,nil,math.huge)) do
  493.                             if Part.Name == "blood" then
  494.                                 tou = Part
  495.                             end
  496.                         end
  497.                         thing:Destroy()
  498.                         if tou.Name == "blood" then
  499.                             local reee = tou.CFrame
  500.                             if tou.Transparency > -0.2 then
  501.                                 tou.Transparency = tou.Transparency - 0.1
  502.                             end
  503.                             local s = 0.025
  504.                             if tou.Color.R > 0 then
  505.                                 local nc = tou.Color.R*1.012
  506.                                 if nc > 1 then
  507.                                     nc = 1
  508.                                 end
  509.                                 tou.Color = Color3.new(nc, 0, 0)
  510.                             end
  511.                             if tou.Size.X < 5 then
  512.                                 tou.Size = tou.Size+Vector3.new(s*4,0,s*4)
  513.                             elseif tou.Size.X < 7.5 then
  514.                                 tou.Size = tou.Size+Vector3.new(s*3,0,s*3)
  515.                             elseif tou.Size.X < 10 then
  516.                                 tou.Size = tou.Size+Vector3.new(s*2,0,s*2)
  517.                             end
  518.                             tou.CFrame = reee
  519.                             local tween = game:GetService("TweenService"):Create(tou,TweenInfo.new(4),{Transparency = 1})
  520.                             tween:Play()
  521.                             tween.Completed:Connect(function()
  522.                                 if tou.Transparency >= 0.9 then
  523.                                     tou:Destroy()
  524.                                 end
  525.                             end)
  526.                         elseif tou.CanCollide == true then
  527.                             local bloodsplat = Instance.new('Part')
  528.                             local s = math.random(5,10)/10
  529.                             if gone_limbs >= 1 then
  530.                                 bloodsplat.Size = Vector3.new(s*gone_limbs,0.2,s*gone_limbs)
  531.                             else
  532.                                 bloodsplat.Size = Vector3.new(s,0.2,s)
  533.                             end
  534.                             bloodsplat.Name = "blood"
  535.                             bloodsplat.Anchored = true
  536.                             bloodsplat.CanCollide = false
  537.                             bloodsplat.Material = Enum.Material.Glass
  538.                             bloodsplat.Color = Color3.fromRGB(75, 0, 0)
  539.                             bloodsplat.Transparency = -0.2
  540.                             bloodsplat.Parent = junk
  541.                             bloodsplat.CFrame = CFrame.new(pos)
  542.                             local mesh = Instance.new('SpecialMesh')
  543.                             mesh.MeshType = Enum.MeshType.Sphere
  544.                             mesh.Parent = bloodsplat
  545.                             local tween = game:GetService("TweenService"):Create(bloodsplat,TweenInfo.new(4),{Transparency = 1})
  546.                             tween:Play()
  547.                             tween.Completed:Connect(function()
  548.                                 if bloodsplat.Transparency >= 0.9 then
  549.                                     bloodsplat:Destroy()
  550.                                 end
  551.                             end)
  552.                         end
  553.                     end
  554.                 end)
  555.             end)
  556.             wait(0.1)
  557.         end
  558.     end)
  559. end
  560.  
  561. function blood_splat(obj,pos,dir)
  562.     local Part0 = Instance.new("Part")
  563.     local ParticleEmitter1 = Instance.new("ParticleEmitter")
  564.     local ParticleEmitter2 = Instance.new("ParticleEmitter")
  565.     local ParticleEmitter3 = Instance.new("ParticleEmitter")
  566.     Part0.Name = "splat"
  567.     Part0.CFrame = CFrame.new(0.00307999994, 0.0250049997, -0.0034119999, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  568.     Part0.Position = Vector3.new(0.00307999994, 0.0250049997, -0.0034119999)
  569.     Part0.Transparency = 1
  570.     Part0.Size = Vector3.new(0.0500000007, 0.0500000007, 0.0500000007)
  571.     Part0.Anchored = true
  572.     Part0.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  573.     Part0.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  574.     Part0.CanCollide = false
  575.     Part0.FrontSurface = Enum.SurfaceType.Hinge
  576.     Part0.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  577.     Part0.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  578.     Part0.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  579.     Part0.FormFactor = Enum.FormFactor.Custom
  580.     Part0.formFactor = Enum.FormFactor.Custom
  581.     ParticleEmitter1.Name = "Blood3"
  582.     ParticleEmitter1.Parent = Part0
  583.     ParticleEmitter1.Speed = NumberRange.new(3, 7)
  584.     ParticleEmitter1.Rotation = NumberRange.new(-360, 360)
  585.     ParticleEmitter1.Color = ColorSequence.new(Color3.new(0.486275, 0, 0),Color3.new(0.258824, 0, 0))
  586.     ParticleEmitter1.Enabled = false
  587.     ParticleEmitter1.LightEmission = 0.20000000298023
  588.     ParticleEmitter1.LightInfluence = 1
  589.     ParticleEmitter1.Texture = "rbxassetid://241779220"
  590.     ParticleEmitter1.Transparency = NumberSequence.new(1,0.48750001192093,0.75625002384186,1)
  591.     ParticleEmitter1.ZOffset = 0.5
  592.     ParticleEmitter1.Size = NumberSequence.new(0,2.8749995231628)
  593.     ParticleEmitter1.Acceleration = Vector3.new(0, -5, 0)
  594.     ParticleEmitter1.EmissionDirection = Enum.NormalId.Front
  595.     ParticleEmitter1.Lifetime = NumberRange.new(0.40000000596046, 1)
  596.     ParticleEmitter1.Rate = 3000
  597.     ParticleEmitter1.RotSpeed = NumberRange.new(-40, 270)
  598.     ParticleEmitter1.SpreadAngle = Vector2.new(360, 360)
  599.     ParticleEmitter1.VelocitySpread = 360
  600.     ParticleEmitter2.Name = "Blood"
  601.     ParticleEmitter2.Parent = Part0
  602.     ParticleEmitter2.Speed = NumberRange.new(5, 10)
  603.     ParticleEmitter2.Rotation = NumberRange.new(-360, 360)
  604.     ParticleEmitter2.Color = ColorSequence.new(Color3.new(0.666667, 0, 0),Color3.new(0.423529, 0, 0))
  605.     ParticleEmitter2.Enabled = false
  606.     ParticleEmitter2.LightEmission = 0.40000000596046
  607.     ParticleEmitter2.LightInfluence = 1
  608.     ParticleEmitter2.Texture = "rbxassetid://73547327"
  609.     ParticleEmitter2.Transparency = NumberSequence.new(0.10000000149012,0.14375001192093,0.49374997615814,1)
  610.     ParticleEmitter2.Size = NumberSequence.new(0,2.8749995231628)
  611.     ParticleEmitter2.Acceleration = Vector3.new(0, -5, 0)
  612.     ParticleEmitter2.EmissionDirection = Enum.NormalId.Front
  613.     ParticleEmitter2.Lifetime = NumberRange.new(0.30000001192093, 0.5)
  614.     ParticleEmitter2.Rate = 10000000
  615.     ParticleEmitter2.RotSpeed = NumberRange.new(-40, 270)
  616.     ParticleEmitter2.SpreadAngle = Vector2.new(360, 360)
  617.     ParticleEmitter2.VelocitySpread = 360
  618.     ParticleEmitter3.Name = "Blood2"
  619.     ParticleEmitter3.Parent = Part0
  620.     ParticleEmitter3.Speed = NumberRange.new(5, 14)
  621.     ParticleEmitter3.Color = ColorSequence.new(Color3.new(0.45098, 0, 0),Color3.new(0.45098, 0, 0))
  622.     ParticleEmitter3.Enabled = false
  623.     ParticleEmitter3.LightEmission = 0.20000000298023
  624.     ParticleEmitter3.LightInfluence = 1
  625.     ParticleEmitter3.Texture = "http://www.roblox.com/asset/?id=134531274"
  626.     ParticleEmitter3.Transparency = NumberSequence.new(0.30000001192093,0.30000001192093)
  627.     ParticleEmitter3.ZOffset = 1
  628.     ParticleEmitter3.Size = NumberSequence.new(0.12499988079071,0)
  629.     ParticleEmitter3.Acceleration = Vector3.new(0, -20, 0)
  630.     ParticleEmitter3.EmissionDirection = Enum.NormalId.Front
  631.     ParticleEmitter3.Lifetime = NumberRange.new(0.5, 1.5)
  632.     ParticleEmitter3.Rate = 100000
  633.     ParticleEmitter3.SpreadAngle = Vector2.new(360, 360)
  634.     ParticleEmitter3.VelocitySpread = 360
  635.     local splat = Part0
  636.     splat.CFrame = CFrame.new(pos,dir)
  637.     splat.Parent = junk
  638.     for i,v in pairs(splat:GetChildren()) do
  639.         v:Emit(30)
  640.     end
  641.     game:GetService("Debris"):AddItem(splat,2)
  642. end
  643.  
  644. function break_limb(plr,obj,targchar,dir)
  645.     local targhum = targchar:FindFirstChildOfClass("Humanoid")
  646.     local targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("HumanoidRootPart")
  647.     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
  648.     local confirm = Instance.new("ObjectValue")
  649.     confirm.Name = 'Dismembered'
  650.     confirm.Parent = obj
  651.     local bsc = obj:FindFirstChildOfClass("BallSocketConstraint")
  652.     if bsc then
  653.         bsc:Destroy()
  654.     end
  655.     bleed2(plr,obj,targhum,true,10,true,dir)
  656.     bleed2(plr,targtorso,targhum,false,10,false,Vector3.new(0,-1,0).Unit)
  657.     local targchar = targhum.Parent
  658.     make_bone(obj,targtorso)
  659.     local kb = 15
  660.     local bv = Instance.new("BodyVelocity")
  661.     bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  662.     bv.Velocity = dir*kb+Vector3.new(0,kb,0)
  663.     bv.Parent = obj
  664.     game:GetService("Debris"):AddItem(bv,0.1)
  665.     local bsc = obj:FindFirstChildOfClass("BallSocketConstraint")
  666.     if bsc then
  667.         bsc:Destroy()
  668.     end
  669.     for _,m in pairs(targchar:GetChildren()) do
  670.         for _,v in pairs(m:GetChildren()) do
  671.             if (v:IsA('Motor6D') or v:IsA('Motor') or v:IsA('Snap') or v:IsA('Weld')) and (v.Part0 == obj or v.Part1 == obj) then
  672.                 v:Destroy()
  673.                 if string.match(obj.Name:lower(),'leg') then
  674.                     targhum.WalkSpeed = targhum.WalkSpeed/1.3
  675.                 end
  676.             end
  677.         end
  678.     end
  679.     limb_collide(obj,1,10)
  680.     obj.Massless = true
  681.     obj.CanCollide = false
  682.     obj.Anchored = false
  683.     game:GetService("Debris"):AddItem(obj,10)
  684. end
  685.  
  686. function ragdoll(targchar,kill,remove)
  687.     local targplr
  688.     pcall(function()
  689.         targplr = game:GetService("Players"):GetPlayerFromCharacter(targchar)
  690.     end)
  691.     local pc = targchar
  692.     local targhum = pc:FindFirstChild("Humanoid")
  693.     local js,js2 = {},{}
  694.  
  695.     if kill then
  696.         local old_pc
  697.         if remove then
  698.             pc.Archivable = true
  699.             old_pc = pc
  700.             pc = pc:Clone()
  701.         end
  702.         for i,v in pairs(pc:GetDescendants()) do
  703.             if v.Name ~= 'HumanoidRootPart' and v.Name ~= 'Torso' and v:IsA("BasePart") then
  704.                 if remove then
  705.                     limb_collide(v,true,10)
  706.                 end
  707.             end
  708.             if v:IsA("ParticleEmitter") then
  709.                 v.Enabled = false
  710.             end
  711.             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
  712.                 if v:IsA("BodyVelocity") then
  713.                     game:GetService("Debris"):AddItem(v,0.15)
  714.                 else
  715.                     v:Destroy()
  716.                 end
  717.             end
  718.             if (v:IsA("Script") and v.Name == 'Health') or (v:IsA("LocalScript") and v.Name == 'Animate') then
  719.                 v:Destroy()
  720.             end
  721.             if v:IsA("Humanoid") then
  722.                 v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  723.                 v.PlatformStand = true
  724.             end
  725.         end
  726.         if remove then
  727.             for i,v in pairs(old_pc:GetDescendants()) do
  728.                 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
  729.                     v:destroy()
  730.                 end
  731.                 if v:IsA("Humanoid") then
  732.                     v.BreakJointsOnDeath = true
  733.                     v.Health = 0
  734.                     v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
  735.                     v.PlatformStand = true
  736.                 end
  737.             end
  738.             pc.Parent = junk
  739.             game:GetService("Debris"):AddItem(pc,10)
  740.         end
  741.     end
  742.     if kill and targhum:FindFirstChild("Ragdolled") then return; end;
  743.     coroutine.resume(coroutine.create(function()
  744.         if targplr then
  745.             for i,v in pairs(pc:GetChildren()) do
  746.                 if v:IsA("BasePart") then
  747.                     --v.Massless = true
  748.                     if v:CanSetNetworkOwnership() then
  749.                         v:SetNetworkOwner(targplr)
  750.                     end
  751.                 end
  752.             end
  753.         end
  754.     end))
  755.     local kb = 15
  756.     local targtorso = pc:FindFirstChild("Torso") or pc:FindFirstChild("UpperTorso") or pc:FindFirstChild("Head") or pc:FindFirstChild("HumanoidRootPart")
  757.     local dir = targtorso.CFrame.lookVector*-1
  758.     local bv = Instance.new("BodyVelocity")
  759.     bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  760.     bv.Velocity = --[[dir*kb+]]Vector3.new(0,kb,0)
  761.     bv.Parent = targtorso
  762.     game:GetService("Debris"):AddItem(bv,0.1)
  763.     local ragval = Instance.new("ObjectValue")
  764.     ragval.Name = 'Ragdolled'
  765.     ragval.Parent = targhum
  766.     spawn(function()
  767.         for _,m in pairs(pc:GetChildren()) do
  768.             for _,v in pairs(m:GetChildren()) do
  769.                 if v:IsA("Snap") or v:IsA('Weld') then
  770.                     v:Destroy()
  771.                 end
  772.                 if (v:IsA('Motor6D') or v:IsA('Motor')) and v.Parent:IsA("Part") then
  773.                     if not kill then
  774.                         table.insert(js2,1,{obj = v,par = v.Parent})
  775.                     end
  776.  
  777.                     local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
  778.                     a0.CFrame = v.C0
  779.                     a1.CFrame = v.C1
  780.                     a0.Parent = v.Part0
  781.                     a1.Parent = v.Part1
  782.  
  783.                     local b = Instance.new("BallSocketConstraint")
  784.                     b.Attachment0 = a0
  785.                     b.Attachment1 = a1
  786.                     b.Parent = v.Part0
  787.  
  788.                     v.Parent = nil
  789.                     table.insert(js,1,b)
  790.                 end
  791.             end
  792.         end
  793.     end)
  794.     pcall(function()
  795.         pc.HumanoidRootPart.CanCollide = false
  796.     end)
  797.     return js,js2
  798. end
  799.  
  800. function kill(plr,targchar,dir,kb)
  801.     local targhum = targchar:FindFirstChildOfClass("Humanoid")
  802.     local targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("HumanoidRootPart")
  803.     if not targhum:FindFirstChild("killer") then else return end
  804.     local kval = Instance.new("ObjectValue")
  805.     kval.Name = 'killer'
  806.     kval.Value = plr
  807.     kval.Parent = targhum
  808.     local bv = Instance.new("BodyVelocity")
  809.     bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  810.     bv.Velocity = dir*kb+Vector3.new(0,kb,0)
  811.     bv.Parent = targtorso
  812.     game:GetService("Debris"):AddItem(bv,0.1)
  813.     pcall(function()
  814.         ragdoll(targchar)
  815.     end)
  816. end
  817.  
  818. 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
  819.  
  820. local e_s = 1
  821.  
  822. function add_decal(f,t,obj)
  823.     --spawn(function()
  824.     if obj:FindFirstChild("blood" .. f) then return end
  825.     local texture = Instance.new("Texture")
  826.     texture.Name = ('blood' .. f)
  827.     texture.Parent = obj
  828.     texture.Face = f
  829.     texture.Texture = 'rbxassetid://' .. t
  830.     game:GetService("Debris"):AddItem(texture,10)
  831.     if f == 'Left' or f == 'Right' then
  832.         texture.StudsPerTileV = obj.Size.Y + e_s
  833.         if (obj.Size.X > obj.Size.Z) then
  834.             texture.StudsPerTileV = obj.Size.Z + e_s
  835.         elseif (obj.Size.Z > obj.Size.X) then
  836.             texture.StudsPerTileU = obj.Size.X + e_s
  837.         else
  838.             texture.StudsPerTileU = obj.Size.X + e_s
  839.         end
  840.     elseif f == 'Front' or f == 'Back' then
  841.         texture.StudsPerTileV = obj.Size.Y + e_s
  842.         if (obj.Size.X > obj.Size.Z) then
  843.             texture.StudsPerTileV = obj.Size.X + e_s
  844.         elseif (obj.Size.Z > obj.Size.X) then
  845.             texture.StudsPerTileU = obj.Size.Z + e_s
  846.         else
  847.             texture.StudsPerTileU = obj.Size.X + e_s
  848.         end
  849.     elseif f == 'Top' or f == 'Bottom' then
  850.         texture.StudsPerTileV = obj.Size.X + e_s
  851.         texture.StudsPerTileU = obj.Size.Z + e_s
  852.     end
  853.     --end)
  854. end
  855.  
  856. function add_blood(obj)
  857.     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)]
  858.     add_decal('Top',t1,obj)
  859.     add_decal('Bottom',t2,obj)
  860.     add_decal('Left',t3,obj)
  861.     add_decal('Right',t4,obj)
  862.     add_decal('Front',t5,obj)
  863.     add_decal('Back',t6,obj)
  864. end
  865.  
  866. function bullet_trail(plr,hitpos,handle)
  867.     local s = 0.1
  868.     local p = Instance.new("Part")
  869.     p.Name = "bullet"
  870.     p.Anchored = false
  871.     p.CanCollide = false
  872.     p.Size = Vector3.new(s,s,s)
  873.     p.Transparency = 1
  874.     p.Position = handle.Position
  875.     local at1,at2 = Instance.new("Attachment"),Instance.new("Attachment")
  876.     at1.Position = Vector3.new(-s/2,0,0)
  877.     at2.Position = Vector3.new(s/2,0,0)
  878.     at1.Parent = p
  879.     at2.Parent = p
  880.     local trail = Instance.new("Trail")
  881.     trail.Attachment0 = at1
  882.     trail.Attachment1 = at2
  883.     trail.FaceCamera = true
  884.     trail.Transparency = NumberSequence.new(0,1)
  885.     trail.Lifetime = 0.1
  886.     trail.MaxLength = 1/0
  887.     trail.MinLength = 0
  888.     trail.Parent = p
  889.     p.Parent = junk
  890.     p:SetNetworkOwner(plr)
  891.     --wait()
  892.     local body_vel = Instance.new("BodyVelocity")
  893.     body_vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  894.     body_vel.Velocity = (hitpos-handle.Position).Unit * 1500
  895.     body_vel.Parent = p
  896.     game:GetService("Debris"):AddItem(p,3)
  897.     return p
  898. end
  899.  
  900. server_remote.OnServerEvent:Connect(function(plr,data,mode)
  901.     local rc = plr.Character
  902.     local rh = rc:FindFirstChildOfClass("Humanoid")
  903.     local handle
  904.     local tool = data.tool
  905.     if tool and tool:IsDescendantOf(rc) then
  906.         handle = tool:FindFirstChild("Handle")
  907.     else
  908.         return
  909.     end
  910.     if alive(rc) then
  911.         local targhum = data.targhum
  912.         local targchar = data.targchar
  913.         local targtorso = data.targtorso
  914.         local targplr = data.targplr
  915.         local targhead = data.targhead
  916.         local obj = data.obj
  917.         local p1 = data.p1
  918.         local p2 = data.p2
  919.         local hitpos = data.hitpos
  920.         if mode == 'dmg' then
  921.             if exists(targchar) then else return end
  922.             blood_splat(obj,hitpos,p2)
  923.             if not obj:FindFirstChild('Dismembered') then
  924.                 local dmg = data.dmg
  925.                 if 0 >= (targhum.Health - dmg) then
  926.                     targhum.BreakJointsOnDeath = false
  927.                 end
  928.                 targhum:TakeDamage(dmg)
  929.                 if math.random(1,10) == 1 and obj.Parent == targchar then
  930.                     if obj.Name == 'Head' then
  931.                         targhum.BreakJointsOnDeath = false
  932.                     end
  933.                     break_limb(plr,obj,targchar,p2)
  934.                 end
  935.                 if not targhum:FindFirstChild("killer") then
  936.                     if not alive(targchar) then
  937.                         wait()
  938.                         if obj.Name == 'Head' and obj.Parent == targchar then
  939.                             break_limb(plr,obj,targchar,p2)
  940.                         end
  941.                         kill(plr,targchar,p2,15)
  942.                     elseif not targtorso:FindFirstChild("pain groan") then
  943.                         local pg = {1489922915,1489934368}
  944.                         local stuns = {
  945.                             5169623605,
  946.                             5169624072,
  947.                             5169626214,
  948.                             5169624072,
  949.                             5169623821,
  950.                             5169626595
  951.                         }
  952.                         local groan = Instance.new("Sound")
  953.                         groan.Name = 'pain groan'
  954.                         groan.SoundId = 'rbxassetid://' .. stuns[math.random(1,#stuns)]
  955.                         groan.Volume = 0.5
  956.                         groan.Parent = targtorso
  957.                         groan:Play()
  958.                         game:GetService("Debris"):AddItem(groan,groan.TimeLength)
  959.                     end
  960.                 end
  961.             end
  962.             bleed2(plr,obj,targhum,true,3,true,p2)
  963.             if obj.Parent == targchar then
  964.                 if obj == targchar:FindFirstChild("HumanoidRootPart") then
  965.                     add_blood(targtorso)
  966.                 else
  967.                     add_blood(obj)
  968.                 end
  969.             end
  970.         elseif mode == 'shoot' then
  971.             local shoot_s = Instance.new("Sound")
  972.             shoot_s.Name = 'shoot'
  973.             shoot_s.SoundId = gundata[tool.Name].shoot_s
  974.             shoot_s.Volume = 0.6
  975.             shoot_s.Parent = handle
  976.             shoot_s:Play()
  977.             bullet_trail(plr,hitpos,handle)
  978.             server_remote:FireAllClients({
  979.                 plr = plr,
  980.                 hitpos = hitpos,
  981.                 handle = handle
  982.             },'shoot')
  983.             game:GetService("Debris"):AddItem(shoot_s,shoot_s.TimeLength)
  984.         elseif mode == 'equip' then
  985.             local equip = Instance.new("Sound")
  986.             equip.SoundId = 'rbxassetid://769464514'
  987.             equip.Volume = 0.8
  988.             equip.Parent = handle
  989.             equip:Play()
  990.             game:GetService("Debris"):AddItem(equip,equip.TimeLength)
  991.         elseif mode == 'reload' then
  992.             local reload_s = Instance.new("Sound")
  993.             reload_s.SoundId = gundata[tool.Name].reload_s
  994.             if tool.Name == 'BFG-50' then
  995.                 reload_s.TimePosition = 1.6
  996.             end
  997.             reload_s.Volume = 0.7
  998.             reload_s.Parent = handle
  999.             reload_s:Play()
  1000.             game:GetService("Debris"):AddItem(reload_s,reload_s.TimeLength)
  1001.         elseif mode == 'break' then
  1002.             local wbreak_s = Instance.new("Sound")
  1003.             wbreak_s.SoundId = "rbxassetid://627558611"
  1004.             wbreak_s.Volume = 0.7
  1005.             wbreak_s.Parent = handle
  1006.             wbreak_s:Play()
  1007.             game:GetService("Debris"):AddItem(wbreak_s,wbreak_s.TimeLength)
  1008.         elseif mode == 'empty' then
  1009.             local empty_s = Instance.new("Sound")
  1010.             empty_s.SoundId = 'rbxassetid://132464034'
  1011.             empty_s.Volume = 0.7
  1012.             empty_s.Parent = handle
  1013.             empty_s:Play()
  1014.             game:GetService("Debris"):AddItem(empty_s,empty_s.TimeLength)
  1015.         elseif mode == 'aim' then
  1016.             local scope_s = Instance.new("Sound")
  1017.             scope_s.SoundId = 'rbxassetid://2862871544'
  1018.             scope_s.Volume = 0.4
  1019.             scope_s.Parent = handle
  1020.             scope_s:Play()
  1021.             game:GetService("Debris"):AddItem(scope_s,scope_s.TimeLength)
  1022.         end
  1023.     end
  1024. end)
  1025. server_remote.Name = 'gun_server_remote'
  1026. function parent()
  1027.     local success = pcall(function()
  1028.         server_remote.Parent = game:GetService("ReplicatedStorage")
  1029.     end)
  1030.     if not success then
  1031.         wait()
  1032.         parent()
  1033.     end
  1034. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement