Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local server_remote = game:GetService("ReplicatedStorage"):FindFirstChild('gun_server_remote') or Instance.new('RemoteEvent',game:GetService("ReplicatedStorage"))
- local gundata = {
- ['AK-47'] = {
- reload_s = 'rbxassetid://3742928054',
- shoot_s = 'rbxassetid://168436671',
- },
- ['M4A1-S'] = {
- reload_s = 'rbxassetid://2232695010',
- shoot_s = 'rbxassetid://4642718673',
- },
- ['G18'] = {
- reload_s = 'rbxassetid://2232697419',
- shoot_s = 'rbxassetid://240718012',
- },
- ['BFG-50'] = {
- reload_s = 'rbxassetid://2775805505',
- shoot_s = 'rbxassetid://590136707',
- },
- ['SSG-08'] = {
- reload_s = 'rbxassetid://4649193317',
- shoot_s = 'rbxassetid://4649186576',
- },
- }
- local junk = workspace:WaitForChild('junk',1) or Instance.new("Folder",workspace)
- junk.Name = 'junk'
- function alive(c)
- 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
- return true
- end
- return false
- end
- function exists(c)
- if c and c:FindFirstChildOfClass("Humanoid") and (c:FindFirstChild("HumanoidRootPart") or c:FindFirstChild("Torso")) and c:FindFirstChild("Head") then
- return true
- end
- return false
- end
- function make_bone(obj,targtorso)
- if obj.Name == 'Left Arm' or obj.Name == 'LeftUpperArm' then
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = targtorso.CFrame
- bone.Size = targtorso.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = targtorso
- weld.C1 = CFrame.new(-0.61,0.77,0.03)*CFrame.Angles(math.rad(90),0,math.rad(90))
- weld.Parent = bone
- targtorso.Anchored = false
- bone.Parent = junk
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://1076136382'
- mesh.TextureId = 'rbxassetid://1076137938'
- mesh.Scale = Vector3.new(0.03,0.03,0.03)
- mesh.Parent = bone
- --
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = obj.CFrame
- bone.Size = obj.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = obj
- weld.C1 = CFrame.new(0.13,0.26,0)
- weld.Parent = bone
- obj.Anchored = false
- bone.Parent = junk
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://36780032'
- mesh.TextureId = 'rbxassetid://36780292'
- mesh.Parent = bone
- elseif obj.Name == 'Right Arm' or obj.Name == 'RightUpperArm' then
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = targtorso.CFrame
- bone.Size = targtorso.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = targtorso
- weld.C1 = CFrame.new(0.61,0.77,0.03)*CFrame.Angles(math.rad(90),0,math.rad(-90))
- weld.Parent = bone
- targtorso.Anchored = false
- bone.Parent = junk
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://1076136382'
- mesh.TextureId = 'rbxassetid://1076137938'
- mesh.Scale = Vector3.new(0.03,0.03,0.03)
- mesh.Parent = bone
- --
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = obj.CFrame
- bone.Size = obj.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = obj
- weld.C1 = CFrame.new(-0.13,0.26,0)
- weld.Parent = bone
- obj.Anchored = false
- bone.Parent = junk
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://36780156'
- mesh.TextureId = 'rbxassetid://36780292'
- mesh.Parent = bone
- elseif obj.Name == 'Left Leg' or obj.Name == 'LeftUpperLeg' then
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = targtorso.CFrame
- bone.Size = targtorso.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = targtorso
- weld.C1 = CFrame.new(-0.6,-0.64,0.11)*CFrame.Angles(0,0,math.rad(180))
- weld.Parent = bone
- targtorso.Anchored = false
- bone.Parent = junk
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://1076136382'
- mesh.TextureId = 'rbxassetid://1076137938'
- mesh.Scale = Vector3.new(0.03,0.03,0.03)
- mesh.Parent = bone
- --
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = obj.CFrame
- bone.Size = obj.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = obj
- weld.C1 = CFrame.new(0,0.09,0.13)
- weld.Parent = bone
- obj.Anchored = false
- bone.Parent = junk
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://36780156'
- mesh.TextureId = 'rbxassetid://36780292'
- mesh.Parent = bone
- elseif obj.Name == 'Right Leg' or obj.Name == 'RightUpperLeg' then
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = targtorso.CFrame
- bone.Size = targtorso.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = targtorso
- weld.C1 = CFrame.new(0.6,-0.64,0.11)*CFrame.Angles(0,0,math.rad(180))
- weld.Parent = bone
- targtorso.Anchored = false
- bone.Parent = junk
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://1076136382'
- mesh.TextureId = 'rbxassetid://1076137938'
- mesh.Scale = Vector3.new(0.03,0.03,0.03)
- mesh.Parent = bone
- --
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = obj.CFrame
- bone.Size = obj.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = obj
- weld.C1 = CFrame.new(0,0.09,0.13)
- weld.Parent = bone
- obj.Anchored = false
- bone.Parent = junk
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://36780195'
- mesh.TextureId = 'rbxassetid://36780292'
- mesh.Parent = bone
- elseif obj.Name == 'Head' then
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = targtorso.CFrame
- bone.Size = targtorso.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(targtorso,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = targtorso
- weld.C1 = CFrame.new(0,0.66,0)
- weld.Parent = bone
- targtorso.Anchored = false
- bone.Parent = junk
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://1076136382'
- mesh.TextureId = 'rbxassetid://1076137938'
- mesh.Scale = Vector3.new(0.03,0.03,0.03)
- mesh.Parent = bone
- --
- local bone = Instance.new("Part")
- bone.Name = 'bone'
- bone.CanCollide = false
- bone.Anchored = false
- bone.CFrame = obj.CFrame
- bone.Size = obj.Size
- bone.Massless = true
- bone.Locked = true
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- game:GetService("PhysicsService"):SetPartCollisionGroup(bone,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = bone
- weld.Part1 = obj
- weld.C1 = CFrame.new(0,-0.23,0)*CFrame.Angles(0,math.rad(-90),0)
- weld.Parent = bone
- obj.Anchored = false
- bone.Parent = junk
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = 'rbxassetid://1076136382'
- mesh.TextureId = 'rbxassetid://1076137938'
- mesh.Scale = Vector3.new(0.03,0.03,0.03)
- mesh.Parent = bone
- end
- end
- function limb_collide(obj,mode,d)
- if (obj:IsA("UnionOperation") or obj:IsA("BasePart")) and not obj:FindFirstChild('limb') then else return end
- local exists = pcall(game:GetService("PhysicsService").GetCollisionGroupId, game:GetService("PhysicsService"), 'Limb Collide')
- if not exists then
- game:GetService("PhysicsService"):CreateCollisionGroup('Limb Collide')
- end
- game:GetService("PhysicsService"):CollisionGroupSetCollidable('Limb Collide','Limb Collide',false)
- --
- local t = {}
- --
- local cb = Instance.new("Part")
- cb.Name = 'limb'
- cb.Transparency = 1
- cb.CanCollide = true
- cb.Anchored = false
- cb.CFrame = obj.CFrame
- cb.Size = obj.Size
- cb.Massless = true
- cb.Locked = true
- game:GetService("PhysicsService"):SetPartCollisionGroup(cb,'Limb Collide')
- game:GetService("PhysicsService"):SetPartCollisionGroup(obj,'Limb Collide')
- local weld = Instance.new("Weld")
- weld.Part0 = cb
- weld.Part1 = obj
- weld.Parent = cb
- obj.Massless = true
- obj.Anchored = false
- if mode or obj:FindFirstChild("Dismembered") then
- cb.Parent = junk -- .Parent
- else
- cb.Parent = junk
- table.insert(t,1,cb)
- end
- if d then
- game:GetService("Debris"):AddItem(cb,d)
- end
- --
- 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
- local lv = Vector3.new() -- Vector3.new(cb.Size.X,0,cb.Size.Z)
- local cb2 = Instance.new("Part")
- cb2.Name = 'limb'
- cb2.Transparency = 1
- cb2.CanCollide = true
- cb2.Anchored = false
- cb2.CFrame = obj.CFrame
- cb2.Size = lv
- cb2.Massless = true
- cb2.Locked = true
- --game:GetService("PhysicsService"):SetPartCollisionGroup(cb2,'Limb Collide')
- local weld2 = Instance.new("Weld")
- weld2.Part0 = cb
- weld2.Part1 = cb2
- weld2.C1 = CFrame.new(0,(cb.Size.Y/2),0)
- weld2.Parent = cb2
- if mode or obj:FindFirstChild("Dismembered") then
- cb2.Parent = junk -- .Parent
- else
- cb2.Parent = junk
- table.insert(t,1,cb2)
- end
- if d then
- game:GetService("Debris"):AddItem(cb2,d)
- end
- end
- --
- return t
- end
- function bleed2(plr,frick,targhum,can_hurt,t,splat,dir)
- spawn(function()
- if frick and targhum then else return end
- --[[
- if not frick:FindFirstChild("bleeding from kry's " .. tool.Name) then else return end
- local tempbleedval = Instance.new("ObjectValue")
- tempbleedval.Name = "bleeding from kry's " .. tool.Name
- tempbleedval.Parent = frick
- ]]
- local bleeding = true
- local rig = targhum.RigType
- local limbs = {'Head','Left Arm','Right Arm','Left Leg','Right Leg','RightUpperLeg','LeftUpperLeg','RightUpperArm','LeftUpperArm','RightLowerLeg','LeftLowerLeg','RightLowerArm','LeftLowerArm','RightFoot','LeftFoot','RightHand','LeftHand'}
- spawn(function()
- wait(t)
- bleeding = false
- --tempbleedval:Destroy()
- end)
- while bleeding do
- if (not frick or not frick.Parent or not frick.Parent.Parent or not targhum or not targhum.Parent) then
- break
- end
- local max_limbs = 0
- local current_limbs = 0
- local gone_limbs = 0
- local targchar = targhum.Parent
- if rig == Enum.HumanoidRigType.R6 then
- max_limbs = 5
- elseif rig == Enum.HumanoidRigType.R15 then
- max_limbs = 13
- end
- for i,v in pairs(targchar:GetChildren()) do
- local found = false
- for i,n in pairs(limbs) do if n == v.Name then found = true; end; end;
- if found and not v:FindFirstChild("Dismembered") then
- current_limbs = current_limbs + 1
- end
- end
- gone_limbs = (max_limbs-current_limbs)
- if targhum and can_hurt then
- if gone_limbs >= 1 then
- if 0 >= (targhum.Health - 0.2*gone_limbs) then
- targhum.BreakJointsOnDeath = false
- end
- targhum:TakeDamage(0.2*gone_limbs)
- else
- if 0 >= (targhum.Health - 0.2) then
- targhum.BreakJointsOnDeath = false
- end
- targhum:TakeDamage(0.2)
- end
- if 0 >= targhum.Health then
- kill(plr,targchar,dir,5)
- end
- end
- spawn(function()
- local vel = (dir*0.5)+Vector3.new(math.random(-5, 5)/40,math.random(-5, 5)/30,math.random(-5, 5)/40)
- local thing = Instance.new('Part')
- thing.Name = "blood_drop"
- thing.Size = Vector3.new(0.1,0.1,0.1)
- thing.CFrame = frick.CFrame*CFrame.new(0,frick.Size.Y/2,0)
- if splat then
- thing.Transparency = 0
- elseif not splat then
- thing.Transparency = 1
- end
- thing.Color = Color3.fromRGB(75, 0, 0)
- thing.Material = Enum.Material.SmoothPlastic
- thing.CanCollide = false
- thing.Velocity = vel
- thing.Parent = junk
- --thing:SetNetworkOwner(plr)
- local mesh = Instance.new('SpecialMesh')
- mesh.MeshType = Enum.MeshType.Sphere
- mesh.Parent = thing
- --game:GetService("Debris"):AddItem(thing,5)
- local att1,att2 = Instance.new("Attachment"),Instance.new("Attachment")
- att1.Parent = thing
- att1.Position = Vector3.new(0,-(thing.Size.Y/2),0)
- att2.Parent = thing
- att2.Position = Vector3.new(0,(thing.Size.Y/2),0)
- if splat then
- local trail_drop = Instance.new("Trail")
- trail_drop.Parent = thing
- trail_drop.Attachment0 = att1
- trail_drop.Attachment1 = att2
- trail_drop.Color = ColorSequence.new(Color3.new(0.5, 0, 0),Color3.new(0.7, 0, 0))
- trail_drop.FaceCamera = true
- trail_drop.LightInfluence = 1
- trail_drop.WidthScale = NumberSequence.new(1,0)
- trail_drop.Transparency = NumberSequence.new(0,1)
- trail_drop.Lifetime = 0.1
- trail_drop.MinLength = 0
- end
- local rawrxd = Instance.new('BodyForce')
- rawrxd.Parent = thing
- rawrxd.Force = vel
- game:GetService("Debris"):AddItem(rawrxd,0.01)
- thing.Touched:connect(function(tou)
- 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
- local pos = Vector3.new(thing.Position.X,(tou.Position.Y+(tou.Size.Y/2))+(0.02/2),thing.Position.Z)
- local Point1 = pos-Vector3.new(0.01,0.01,0.01)
- local Point2 = pos+Vector3.new(0.01,0.01,0.01)
- local Region = Region3.new(Point1,Point2)
- for _,Part in pairs(game.Workspace:FindPartsInRegion3(Region,nil,math.huge)) do
- if Part.Name == "blood" then
- tou = Part
- end
- end
- thing:Destroy()
- if tou.Name == "blood" then
- local reee = tou.CFrame
- if tou.Transparency > -0.2 then
- tou.Transparency = tou.Transparency - 0.1
- end
- local s = 0.025
- if tou.Color.R > 0 then
- local nc = tou.Color.R*1.012
- if nc > 1 then
- nc = 1
- end
- tou.Color = Color3.new(nc, 0, 0)
- end
- if tou.Size.X < 5 then
- tou.Size = tou.Size+Vector3.new(s*4,0,s*4)
- elseif tou.Size.X < 7.5 then
- tou.Size = tou.Size+Vector3.new(s*3,0,s*3)
- elseif tou.Size.X < 10 then
- tou.Size = tou.Size+Vector3.new(s*2,0,s*2)
- end
- tou.CFrame = reee
- local tween = game:GetService("TweenService"):Create(tou,TweenInfo.new(4),{Transparency = 1})
- tween:Play()
- tween.Completed:Connect(function()
- if tou.Transparency >= 0.9 then
- tou:Destroy()
- end
- end)
- elseif tou.CanCollide == true then
- local bloodsplat = Instance.new('Part')
- local s = math.random(5,10)/10
- if gone_limbs >= 1 then
- bloodsplat.Size = Vector3.new(s*gone_limbs,0.2,s*gone_limbs)
- else
- bloodsplat.Size = Vector3.new(s,0.2,s)
- end
- bloodsplat.Name = "blood"
- bloodsplat.Anchored = true
- bloodsplat.CanCollide = false
- bloodsplat.Material = Enum.Material.Glass
- bloodsplat.Color = Color3.fromRGB(75, 0, 0)
- bloodsplat.Transparency = -0.2
- bloodsplat.Parent = junk
- bloodsplat.CFrame = CFrame.new(pos)
- local mesh = Instance.new('SpecialMesh')
- mesh.MeshType = Enum.MeshType.Sphere
- mesh.Parent = bloodsplat
- local tween = game:GetService("TweenService"):Create(bloodsplat,TweenInfo.new(4),{Transparency = 1})
- tween:Play()
- tween.Completed:Connect(function()
- if bloodsplat.Transparency >= 0.9 then
- bloodsplat:Destroy()
- end
- end)
- end
- end
- end)
- end)
- wait(0.1)
- end
- end)
- end
- function blood_splat(obj,pos,dir)
- local Part0 = Instance.new("Part")
- local ParticleEmitter1 = Instance.new("ParticleEmitter")
- local ParticleEmitter2 = Instance.new("ParticleEmitter")
- local ParticleEmitter3 = Instance.new("ParticleEmitter")
- Part0.Name = "splat"
- Part0.CFrame = CFrame.new(0.00307999994, 0.0250049997, -0.0034119999, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part0.Position = Vector3.new(0.00307999994, 0.0250049997, -0.0034119999)
- Part0.Transparency = 1
- Part0.Size = Vector3.new(0.0500000007, 0.0500000007, 0.0500000007)
- Part0.Anchored = true
- Part0.BackSurface = Enum.SurfaceType.SmoothNoOutlines
- Part0.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
- Part0.CanCollide = false
- Part0.FrontSurface = Enum.SurfaceType.Hinge
- Part0.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
- Part0.RightSurface = Enum.SurfaceType.SmoothNoOutlines
- Part0.TopSurface = Enum.SurfaceType.SmoothNoOutlines
- Part0.FormFactor = Enum.FormFactor.Custom
- Part0.formFactor = Enum.FormFactor.Custom
- ParticleEmitter1.Name = "Blood3"
- ParticleEmitter1.Parent = Part0
- ParticleEmitter1.Speed = NumberRange.new(3, 7)
- ParticleEmitter1.Rotation = NumberRange.new(-360, 360)
- ParticleEmitter1.Color = ColorSequence.new(Color3.new(0.486275, 0, 0),Color3.new(0.258824, 0, 0))
- ParticleEmitter1.Enabled = false
- ParticleEmitter1.LightEmission = 0.20000000298023
- ParticleEmitter1.LightInfluence = 1
- ParticleEmitter1.Texture = "rbxassetid://241779220"
- ParticleEmitter1.Transparency = NumberSequence.new(1,0.48750001192093,0.75625002384186,1)
- ParticleEmitter1.ZOffset = 0.5
- ParticleEmitter1.Size = NumberSequence.new(0,2.8749995231628)
- ParticleEmitter1.Acceleration = Vector3.new(0, -5, 0)
- ParticleEmitter1.EmissionDirection = Enum.NormalId.Front
- ParticleEmitter1.Lifetime = NumberRange.new(0.40000000596046, 1)
- ParticleEmitter1.Rate = 3000
- ParticleEmitter1.RotSpeed = NumberRange.new(-40, 270)
- ParticleEmitter1.SpreadAngle = Vector2.new(360, 360)
- ParticleEmitter1.VelocitySpread = 360
- ParticleEmitter2.Name = "Blood"
- ParticleEmitter2.Parent = Part0
- ParticleEmitter2.Speed = NumberRange.new(5, 10)
- ParticleEmitter2.Rotation = NumberRange.new(-360, 360)
- ParticleEmitter2.Color = ColorSequence.new(Color3.new(0.666667, 0, 0),Color3.new(0.423529, 0, 0))
- ParticleEmitter2.Enabled = false
- ParticleEmitter2.LightEmission = 0.40000000596046
- ParticleEmitter2.LightInfluence = 1
- ParticleEmitter2.Texture = "rbxassetid://73547327"
- ParticleEmitter2.Transparency = NumberSequence.new(0.10000000149012,0.14375001192093,0.49374997615814,1)
- ParticleEmitter2.Size = NumberSequence.new(0,2.8749995231628)
- ParticleEmitter2.Acceleration = Vector3.new(0, -5, 0)
- ParticleEmitter2.EmissionDirection = Enum.NormalId.Front
- ParticleEmitter2.Lifetime = NumberRange.new(0.30000001192093, 0.5)
- ParticleEmitter2.Rate = 10000000
- ParticleEmitter2.RotSpeed = NumberRange.new(-40, 270)
- ParticleEmitter2.SpreadAngle = Vector2.new(360, 360)
- ParticleEmitter2.VelocitySpread = 360
- ParticleEmitter3.Name = "Blood2"
- ParticleEmitter3.Parent = Part0
- ParticleEmitter3.Speed = NumberRange.new(5, 14)
- ParticleEmitter3.Color = ColorSequence.new(Color3.new(0.45098, 0, 0),Color3.new(0.45098, 0, 0))
- ParticleEmitter3.Enabled = false
- ParticleEmitter3.LightEmission = 0.20000000298023
- ParticleEmitter3.LightInfluence = 1
- ParticleEmitter3.Texture = "http://www.roblox.com/asset/?id=134531274"
- ParticleEmitter3.Transparency = NumberSequence.new(0.30000001192093,0.30000001192093)
- ParticleEmitter3.ZOffset = 1
- ParticleEmitter3.Size = NumberSequence.new(0.12499988079071,0)
- ParticleEmitter3.Acceleration = Vector3.new(0, -20, 0)
- ParticleEmitter3.EmissionDirection = Enum.NormalId.Front
- ParticleEmitter3.Lifetime = NumberRange.new(0.5, 1.5)
- ParticleEmitter3.Rate = 100000
- ParticleEmitter3.SpreadAngle = Vector2.new(360, 360)
- ParticleEmitter3.VelocitySpread = 360
- local splat = Part0
- splat.CFrame = CFrame.new(pos,dir)
- splat.Parent = junk
- for i,v in pairs(splat:GetChildren()) do
- v:Emit(30)
- end
- game:GetService("Debris"):AddItem(splat,2)
- end
- function break_limb(plr,obj,targchar,dir)
- local targhum = targchar:FindFirstChildOfClass("Humanoid")
- local targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("HumanoidRootPart")
- 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
- local confirm = Instance.new("ObjectValue")
- confirm.Name = 'Dismembered'
- confirm.Parent = obj
- local bsc = obj:FindFirstChildOfClass("BallSocketConstraint")
- if bsc then
- bsc:Destroy()
- end
- bleed2(plr,obj,targhum,true,10,true,dir)
- bleed2(plr,targtorso,targhum,false,10,false,Vector3.new(0,-1,0).Unit)
- local targchar = targhum.Parent
- make_bone(obj,targtorso)
- local kb = 15
- local bv = Instance.new("BodyVelocity")
- bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- bv.Velocity = dir*kb+Vector3.new(0,kb,0)
- bv.Parent = obj
- game:GetService("Debris"):AddItem(bv,0.1)
- local bsc = obj:FindFirstChildOfClass("BallSocketConstraint")
- if bsc then
- bsc:Destroy()
- end
- for _,m in pairs(targchar:GetChildren()) do
- for _,v in pairs(m:GetChildren()) do
- 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
- v:Destroy()
- if string.match(obj.Name:lower(),'leg') then
- targhum.WalkSpeed = targhum.WalkSpeed/1.3
- end
- end
- end
- end
- limb_collide(obj,1,10)
- obj.Massless = true
- obj.CanCollide = false
- obj.Anchored = false
- game:GetService("Debris"):AddItem(obj,10)
- end
- function ragdoll(targchar,kill,remove)
- local targplr
- pcall(function()
- targplr = game:GetService("Players"):GetPlayerFromCharacter(targchar)
- end)
- local pc = targchar
- local targhum = pc:FindFirstChild("Humanoid")
- local js,js2 = {},{}
- if kill then
- local old_pc
- if remove then
- pc.Archivable = true
- old_pc = pc
- pc = pc:Clone()
- end
- for i,v in pairs(pc:GetDescendants()) do
- if v.Name ~= 'HumanoidRootPart' and v.Name ~= 'Torso' and v:IsA("BasePart") then
- if remove then
- limb_collide(v,true,10)
- end
- end
- if v:IsA("ParticleEmitter") then
- v.Enabled = false
- end
- 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
- if v:IsA("BodyVelocity") then
- game:GetService("Debris"):AddItem(v,0.15)
- else
- v:Destroy()
- end
- end
- if (v:IsA("Script") and v.Name == 'Health') or (v:IsA("LocalScript") and v.Name == 'Animate') then
- v:Destroy()
- end
- if v:IsA("Humanoid") then
- v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
- v.PlatformStand = true
- end
- end
- if remove then
- for i,v in pairs(old_pc:GetDescendants()) do
- 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
- v:destroy()
- end
- if v:IsA("Humanoid") then
- v.BreakJointsOnDeath = true
- v.Health = 0
- v.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff
- v.PlatformStand = true
- end
- end
- pc.Parent = junk
- game:GetService("Debris"):AddItem(pc,10)
- end
- end
- if kill and targhum:FindFirstChild("Ragdolled") then return; end;
- coroutine.resume(coroutine.create(function()
- if targplr then
- for i,v in pairs(pc:GetChildren()) do
- if v:IsA("BasePart") then
- --v.Massless = true
- if v:CanSetNetworkOwnership() then
- v:SetNetworkOwner(targplr)
- end
- end
- end
- end
- end))
- local kb = 15
- local targtorso = pc:FindFirstChild("Torso") or pc:FindFirstChild("UpperTorso") or pc:FindFirstChild("Head") or pc:FindFirstChild("HumanoidRootPart")
- local dir = targtorso.CFrame.lookVector*-1
- local bv = Instance.new("BodyVelocity")
- bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- bv.Velocity = --[[dir*kb+]]Vector3.new(0,kb,0)
- bv.Parent = targtorso
- game:GetService("Debris"):AddItem(bv,0.1)
- local ragval = Instance.new("ObjectValue")
- ragval.Name = 'Ragdolled'
- ragval.Parent = targhum
- spawn(function()
- for _,m in pairs(pc:GetChildren()) do
- for _,v in pairs(m:GetChildren()) do
- if v:IsA("Snap") or v:IsA('Weld') then
- v:Destroy()
- end
- if (v:IsA('Motor6D') or v:IsA('Motor')) and v.Parent:IsA("Part") then
- if not kill then
- table.insert(js2,1,{obj = v,par = v.Parent})
- end
- local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
- a0.CFrame = v.C0
- a1.CFrame = v.C1
- a0.Parent = v.Part0
- a1.Parent = v.Part1
- local b = Instance.new("BallSocketConstraint")
- b.Attachment0 = a0
- b.Attachment1 = a1
- b.Parent = v.Part0
- v.Parent = nil
- table.insert(js,1,b)
- end
- end
- end
- end)
- pcall(function()
- pc.HumanoidRootPart.CanCollide = false
- end)
- return js,js2
- end
- function kill(plr,targchar,dir,kb)
- local targhum = targchar:FindFirstChildOfClass("Humanoid")
- local targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("HumanoidRootPart")
- if not targhum:FindFirstChild("killer") then else return end
- local kval = Instance.new("ObjectValue")
- kval.Name = 'killer'
- kval.Value = plr
- kval.Parent = targhum
- local bv = Instance.new("BodyVelocity")
- bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- bv.Velocity = dir*kb+Vector3.new(0,kb,0)
- bv.Parent = targtorso
- game:GetService("Debris"):AddItem(bv,0.1)
- pcall(function()
- ragdoll(targchar)
- end)
- end
- 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
- local e_s = 1
- function add_decal(f,t,obj)
- --spawn(function()
- if obj:FindFirstChild("blood" .. f) then return end
- local texture = Instance.new("Texture")
- texture.Name = ('blood' .. f)
- texture.Parent = obj
- texture.Face = f
- texture.Texture = 'rbxassetid://' .. t
- game:GetService("Debris"):AddItem(texture,10)
- if f == 'Left' or f == 'Right' then
- texture.StudsPerTileV = obj.Size.Y + e_s
- if (obj.Size.X > obj.Size.Z) then
- texture.StudsPerTileV = obj.Size.Z + e_s
- elseif (obj.Size.Z > obj.Size.X) then
- texture.StudsPerTileU = obj.Size.X + e_s
- else
- texture.StudsPerTileU = obj.Size.X + e_s
- end
- elseif f == 'Front' or f == 'Back' then
- texture.StudsPerTileV = obj.Size.Y + e_s
- if (obj.Size.X > obj.Size.Z) then
- texture.StudsPerTileV = obj.Size.X + e_s
- elseif (obj.Size.Z > obj.Size.X) then
- texture.StudsPerTileU = obj.Size.Z + e_s
- else
- texture.StudsPerTileU = obj.Size.X + e_s
- end
- elseif f == 'Top' or f == 'Bottom' then
- texture.StudsPerTileV = obj.Size.X + e_s
- texture.StudsPerTileU = obj.Size.Z + e_s
- end
- --end)
- end
- function add_blood(obj)
- 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)]
- add_decal('Top',t1,obj)
- add_decal('Bottom',t2,obj)
- add_decal('Left',t3,obj)
- add_decal('Right',t4,obj)
- add_decal('Front',t5,obj)
- add_decal('Back',t6,obj)
- end
- function bullet_trail(plr,hitpos,handle)
- local s = 0.1
- local p = Instance.new("Part")
- p.Name = "bullet"
- p.Anchored = false
- p.CanCollide = false
- p.Size = Vector3.new(s,s,s)
- p.Transparency = 1
- p.Position = handle.Position
- local at1,at2 = Instance.new("Attachment"),Instance.new("Attachment")
- at1.Position = Vector3.new(-s/2,0,0)
- at2.Position = Vector3.new(s/2,0,0)
- at1.Parent = p
- at2.Parent = p
- local trail = Instance.new("Trail")
- trail.Attachment0 = at1
- trail.Attachment1 = at2
- trail.FaceCamera = true
- trail.Transparency = NumberSequence.new(0,1)
- trail.Lifetime = 0.1
- trail.MaxLength = 1/0
- trail.MinLength = 0
- trail.Parent = p
- p.Parent = junk
- p:SetNetworkOwner(plr)
- --wait()
- local body_vel = Instance.new("BodyVelocity")
- body_vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- body_vel.Velocity = (hitpos-handle.Position).Unit * 1500
- body_vel.Parent = p
- game:GetService("Debris"):AddItem(p,3)
- return p
- end
- server_remote.OnServerEvent:Connect(function(plr,data,mode)
- local rc = plr.Character
- local rh = rc:FindFirstChildOfClass("Humanoid")
- local handle
- local tool = data.tool
- if tool and tool:IsDescendantOf(rc) then
- handle = tool:FindFirstChild("Handle")
- else
- return
- end
- if alive(rc) then
- local targhum = data.targhum
- local targchar = data.targchar
- local targtorso = data.targtorso
- local targplr = data.targplr
- local targhead = data.targhead
- local obj = data.obj
- local p1 = data.p1
- local p2 = data.p2
- local hitpos = data.hitpos
- if mode == 'dmg' then
- if exists(targchar) then else return end
- blood_splat(obj,hitpos,p2)
- if not obj:FindFirstChild('Dismembered') then
- local dmg = data.dmg
- if 0 >= (targhum.Health - dmg) then
- targhum.BreakJointsOnDeath = false
- end
- targhum:TakeDamage(dmg)
- if math.random(1,10) == 1 and obj.Parent == targchar then
- if obj.Name == 'Head' then
- targhum.BreakJointsOnDeath = false
- end
- break_limb(plr,obj,targchar,p2)
- end
- if not targhum:FindFirstChild("killer") then
- if not alive(targchar) then
- wait()
- if obj.Name == 'Head' and obj.Parent == targchar then
- break_limb(plr,obj,targchar,p2)
- end
- kill(plr,targchar,p2,15)
- elseif not targtorso:FindFirstChild("pain groan") then
- local pg = {1489922915,1489934368}
- local stuns = {
- 5169623605,
- 5169624072,
- 5169626214,
- 5169624072,
- 5169623821,
- 5169626595
- }
- local groan = Instance.new("Sound")
- groan.Name = 'pain groan'
- groan.SoundId = 'rbxassetid://' .. stuns[math.random(1,#stuns)]
- groan.Volume = 0.5
- groan.Parent = targtorso
- groan:Play()
- game:GetService("Debris"):AddItem(groan,groan.TimeLength)
- end
- end
- end
- bleed2(plr,obj,targhum,true,3,true,p2)
- if obj.Parent == targchar then
- if obj == targchar:FindFirstChild("HumanoidRootPart") then
- add_blood(targtorso)
- else
- add_blood(obj)
- end
- end
- elseif mode == 'shoot' then
- local shoot_s = Instance.new("Sound")
- shoot_s.Name = 'shoot'
- shoot_s.SoundId = gundata[tool.Name].shoot_s
- shoot_s.Volume = 0.6
- shoot_s.Parent = handle
- shoot_s:Play()
- bullet_trail(plr,hitpos,handle)
- server_remote:FireAllClients({
- plr = plr,
- hitpos = hitpos,
- handle = handle
- },'shoot')
- game:GetService("Debris"):AddItem(shoot_s,shoot_s.TimeLength)
- elseif mode == 'equip' then
- local equip = Instance.new("Sound")
- equip.SoundId = 'rbxassetid://769464514'
- equip.Volume = 0.8
- equip.Parent = handle
- equip:Play()
- game:GetService("Debris"):AddItem(equip,equip.TimeLength)
- elseif mode == 'reload' then
- local reload_s = Instance.new("Sound")
- reload_s.SoundId = gundata[tool.Name].reload_s
- if tool.Name == 'BFG-50' then
- reload_s.TimePosition = 1.6
- end
- reload_s.Volume = 0.7
- reload_s.Parent = handle
- reload_s:Play()
- game:GetService("Debris"):AddItem(reload_s,reload_s.TimeLength)
- elseif mode == 'break' then
- local wbreak_s = Instance.new("Sound")
- wbreak_s.SoundId = "rbxassetid://627558611"
- wbreak_s.Volume = 0.7
- wbreak_s.Parent = handle
- wbreak_s:Play()
- game:GetService("Debris"):AddItem(wbreak_s,wbreak_s.TimeLength)
- elseif mode == 'empty' then
- local empty_s = Instance.new("Sound")
- empty_s.SoundId = 'rbxassetid://132464034'
- empty_s.Volume = 0.7
- empty_s.Parent = handle
- empty_s:Play()
- game:GetService("Debris"):AddItem(empty_s,empty_s.TimeLength)
- elseif mode == 'aim' then
- local scope_s = Instance.new("Sound")
- scope_s.SoundId = 'rbxassetid://2862871544'
- scope_s.Volume = 0.4
- scope_s.Parent = handle
- scope_s:Play()
- game:GetService("Debris"):AddItem(scope_s,scope_s.TimeLength)
- end
- end
- end)
- server_remote.Name = 'gun_server_remote'
- function parent()
- local success = pcall(function()
- server_remote.Parent = game:GetService("ReplicatedStorage")
- end)
- if not success then
- wait()
- parent()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement