Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr,char,hum,root
- plr = owner
- char = plr.Character
- hum = char:FindFirstChildOfClass("Humanoid")
- root = char:FindFirstChild("HumanoidRootPart")
- head = char:FindFirstChild("Head")
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- Tool0.Name = "Glock"
- Tool0.Parent = nil
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.CFrame = CFrame.new(-9.40400028, 0.49000001, -11.9640007, -1, 0, 8.74227766e-08, 0, 1, 0, -8.74227766e-08, 0, -1)
- Part1.Orientation = Vector3.new(0, 180, 0)
- Part1.Position = Vector3.new(-9.40400028, 0.49000001, -11.9640007)
- Part1.Rotation = Vector3.new(-180, 0, -180)
- Part1.Size = Vector3.new(1.44400001, 0.980000019, 0.231999993)
- Part1.Anchored = true
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.CanCollide = false
- Part1.TopSurface = Enum.SurfaceType.Smooth
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "rbxassetid://543260475"
- SpecialMesh2.Scale = Vector3.new(0.0710000023, 0.0710000023, 0.0710000023)
- SpecialMesh2.TextureId = "rbxassetid://543261418"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- local tool,handle
- tool = Tool0
- handle = tool:FindFirstChild("Handle")
- for i,v in pairs(tool:GetChildren()) do
- if v:IsA("BasePart") then
- v.Anchored = false
- v.CanCollide = false
- v.Locked = true
- if v ~= handle then
- local weld = Instance.new("Weld")
- weld.Part0 = handle
- weld.Part1 = v
- weld.C0 = handle.CFrame:Inverse()
- weld.C1 = v.CFrame:Inverse()
- weld.Parent = v
- else
- v.CanCollide = true
- end
- end
- end
- tool.Parent = plr:FindFirstChildOfClass("Backpack")
- local grips = {
- shooting = CFrame.new(-0.335572511, -0.202204779, -0.00730848266, 1.17396892e-08, 0.17555213, -0.984470129, -2.09343809e-09, 0.984470129, 0.17555213, 1, 0, 1.19248806e-08),
- equipped = CFrame.new(-0.331445694, -0.158765793, -0.00730848266, 1.19248806e-08, 0, -1, 0, 1, 0, 1, 0, 1.19248806e-08),
- }
- tool.Grip = grips.equipped
- local bulletfire = 3
- local shootwait = 0.2/bulletfire
- local max_tot_ammo = 1/0
- local tot_ammo = max_tot_ammo
- local max_ammo = 18
- local ammo = max_ammo
- local recoil = 0
- local using = false
- local equipped = false
- local op = false
- local hud = nil
- local remote = nil
- local junk = workspace:FindFirstChild("junk") or workspace
- local bullettype = 1
- local bullettypes = {
- [1] = { -- small (smgs, pistols)
- mesh = 'http://www.roblox.com/asset/?id=95387759',
- texture = 'http://www.roblox.com/asset/?id=95387789',
- scale = Vector3.new(1.8, 1.8, 1.8),
- size = Vector3.new(0.12, 0.12, 0.21)
- },
- [2] = { -- medium (rifles)
- mesh = 'http://www.roblox.com/asset/?id=95392019',
- texture = 'http://www.roblox.com/asset/?id=95391833',
- scale = Vector3.new(0.9, 0.9, 0.9),
- size = Vector3.new(0.12, 0.12, 0.192)
- },
- [3] = { -- big (snipers, big bois)
- mesh = 'http://www.roblox.com/asset/?id=94295100',
- texture = 'http://www.roblox.com/asset/?id=94287792',
- scale = Vector3.new(2.4, 2.4, 2.4),
- size = Vector3.new(0.12, 0.12, 0.372)
- },
- [4] = { -- medium (shotguns)
- mesh = 'http://www.roblox.com/asset/?id=94248124',
- texture = 'http://www.roblox.com/asset/?id=94219470',
- scale = Vector3.new(0.45, 0.45, 0.45),
- size = Vector3.new(0.12, 0.12, 0.234)
- },
- }
- local equip = Instance.new("Sound")
- equip.SoundId = 'rbxassetid://769464514'
- equip.Volume = 0.8
- equip.Parent = handle
- local reload_s = Instance.new("Sound")
- reload_s.SoundId = 'rbxassetid://269172810'
- reload_s.Volume = 0.7
- reload_s.Parent = handle
- local wbreak_s = Instance.new("Sound")
- wbreak_s.SoundId = "rbxassetid://627558611"
- wbreak_s.Volume = 0.7
- wbreak_s.Parent = handle
- local empty_s = Instance.new("Sound")
- empty_s.SoundId = 'rbxassetid://132464034'
- empty_s.Volume = 0.7
- empty_s.Parent = handle
- local shoots = {}
- for i = 1,bulletfire do
- local shoot_s = Instance.new("Sound")
- shoot_s.Name = 'shoot'
- shoot_s.SoundId = 'rbxassetid://240718012'
- shoot_s.Volume = 2
- shoot_s.Parent = handle
- shoots['shoot' .. i] = shoot_s
- end
- local effect_part = Instance.new("Part")
- local smoke = Instance.new("ParticleEmitter")
- local flash = Instance.new("ParticleEmitter")
- local light = Instance.new("PointLight")
- effect_part.Name = "effect"
- effect_part.Parent = tool
- effect_part.CFrame = CFrame.new(-14.3099976, 2.64201403, -6.57999992)
- effect_part.Transparency = 1
- effect_part.Size = Vector3.new(0.100000001, 0.100000001, 0.100000001)
- effect_part.BottomSurface = Enum.SurfaceType.Smooth
- effect_part.CanCollide = false
- effect_part.TopSurface = Enum.SurfaceType.Smooth
- smoke.Name = "smoke"
- smoke.Parent = effect_part
- smoke.Speed = NumberRange.new(5, 7)
- smoke.Rotation = NumberRange.new(0, 360)
- smoke.Color = ColorSequence.new(Color3.new(0.27451, 0.27451, 0.27451),Color3.new(0.27451, 0.27451, 0.27451))
- smoke.Enabled = false
- smoke.LightEmission = 0.10000000149012
- smoke.Texture = "http://www.roblox.com/asset/?id=244514423"
- smoke.Transparency = NumberSequence.new(0.60000002384186,1)
- smoke.Size = NumberSequence.new(0.99999964237213,3)
- smoke.Lifetime = NumberRange.new(1.25, 1.5)
- smoke.Rate = 100
- smoke.RotSpeed = NumberRange.new(10, 10)
- smoke.SpreadAngle = Vector2.new(15, 15)
- smoke.VelocitySpread = 15
- flash.Name = "flash"
- flash.Parent = effect_part
- flash.Speed = NumberRange.new(0, 0)
- flash.Rotation = NumberRange.new(0, 90)
- flash.Color = ColorSequence.new(Color3.new(1, 1, 0.498039),Color3.new(1, 1, 0.498039))
- flash.Enabled = false
- flash.LightEmission = 1
- flash.Texture = "http://www.roblox.com/asset/?id=3419963"
- flash.Transparency = NumberSequence.new(0.75,1)
- flash.Size = NumberSequence.new(0.20000000298023,0.20000000298023)
- flash.Lifetime = NumberRange.new(0.050000000745058, 0.075000002980232)
- flash.Speed = NumberRange.new(50,50)
- flash.Rate = 1000
- light.Name = "light"
- light.Parent = effect_part
- light.Color = Color3.new(1, 1, 0.498039)
- light.Enabled = false
- light.Range = 6
- light.Brightness = 10
- light.Shadows = true
- local weld = Instance.new("Weld")
- weld.Part0 = handle
- weld.Part1 = effect_part
- weld.C0 = weld.C0 * CFrame.new((handle.Size.X/2),0.35,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(-90))
- weld.Parent = effect_part
- function usefx()
- spawn(function()
- local mode = true
- light.Enabled = mode
- flash.Enabled = mode
- smoke.Enabled = mode
- wait()
- mode = false
- light.Enabled = mode
- flash.Enabled = mode
- smoke.Enabled = mode
- end)
- end
- 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 reload()
- if max_ammo > ammo then else return end
- empty_s:Play()
- if 0 >= tot_ammo then
- return
- end
- using = true
- reload_s:Play()
- local mag = Instance.new("Part")
- mag.Name = 'gun mag'
- mag.Size = Vector3.new(0.48, 0.8, 0.14)
- mag.Color = handle.Color
- mag.Parent = junk
- mag.CFrame = handle.CFrame * CFrame.new(0.1,-0.1,0)
- --[[
- local m = gun.Mag:Clone()
- m.CanCollide = true
- m:FindFirstChild("Weld"):Destroy()
- m.Parent = junk
- ]]
- game:GetService("Debris"):AddItem(mag,10)
- repeat wait() until not reload_s.IsPlaying --[[or not equipped]]
- --[[
- if not equipped then
- using = false
- reload_s:Stop()
- return
- end
- ]]
- if max_ammo >= tot_ammo then
- ammo = ammo + tot_ammo
- tot_ammo = 0
- if ammo > max_ammo then
- local reserve = ammo-max_ammo
- ammo = ammo - reserve
- tot_ammo = tot_ammo + reserve
- end
- elseif tot_ammo > max_ammo then
- ammo = ammo + max_ammo
- tot_ammo = tot_ammo - max_ammo
- if ammo > max_ammo then
- local reserve = ammo-max_ammo
- ammo = ammo - reserve
- tot_ammo = tot_ammo + reserve
- end
- end
- if equipped then
- if hud then
- hud.ammo.Text = ammo .. '/' .. tot_ammo
- end
- end
- using = false
- end
- function drop_shell()
- local Shell = Instance.new("Part")
- Shell.Color = Color3.new(1, 1, 0)
- Shell.BottomSurface = Enum.SurfaceType.Smooth
- Shell.BrickColor = BrickColor.new("New Yeller")
- Shell.Material = Enum.Material.Metal
- Shell.Shape = Enum.PartType.Cylinder
- Shell.CFrame = handle.CFrame
- local bt = bullettypes[bullettype]
- local mesh = Instance.new("SpecialMesh")
- mesh.MeshId = bt.mesh
- mesh.TextureId = bt.texture
- mesh.Scale = bt.scale
- mesh.Parent = Shell
- Shell.Size = bt.size
- Shell.Parent = junk
- local bvs = Instance.new("BodyVelocity")
- bvs.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- bvs.Velocity = ((handle.CFrame.lookVector*-1)+Vector3.new(0,2,0))*5
- bvs.Parent = Shell
- game:GetService("Debris"):AddItem(bvs,0.1)
- game:GetService("Debris"):AddItem(Shell,10)
- end
- function raycast(Pos, Dir, Max, Ignore)
- local rayparams = RaycastParams.new()
- rayparams.FilterType = Enum.RaycastFilterType.Blacklist
- rayparams.FilterDescendantsInstances = Ignore
- rayparams.IgnoreWater = true
- return workspace:Raycast(Pos, Dir * (Max or 999.999), rayparams)
- end
- function bullet_trail(mousepos)
- spawn(function()
- 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.5
- 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 = (mousepos-handle.Position).Unit * 2500
- body_vel.Parent = p
- game:GetService("Debris"):AddItem(p,3)
- 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 break_window(hit)
- if hit.Material == Enum.Material.Glass --[[hit.Name == 'window']] and hit.Name ~= 'window shatter' and hit.Name ~= 'blood' and hit.Name ~= 'blood_drop' then else return end
- hit.Name = ''
- local wbreak = wbreak_s:Clone()
- wbreak.Parent = hit
- wbreak:Play()
- local sx,sy,sz = hit.Size.x,hit.Size.y,hit.Size.z
- for x = 1,4 do
- for y = 1,4 do
- local part = hit:Clone()
- local position = Vector3.new(x-2.1,y-2.1,0)*Vector3.new(sx/4,sy/4,sz)
- part.Size = Vector3.new(sx/4,sy/4,sz)
- part.CFrame = hit.CFrame*(CFrame.new(part.Size/8)-hit.Size/8+position)
- part.Velocity = Vector3.new(math.random(-10,10),math.random(-10,10),math.random(-10,10))
- part.Name = "window shatter"
- part.Parent = hit.Parent
- game:GetService("Debris"):AddItem(part,2)
- spawn(function()
- wait(0.5)
- for i = 1,10 do
- part.Transparency = part.Transparency+0.05
- wait(0.05)
- end
- part:Destroy()
- end)
- part.Anchored = false
- end
- end
- hit:Destroy()
- 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 kill(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.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,true)
- end)
- end
- function bleed2(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(targchar,dir,5)
- end
- end
- spawn(function()
- local thing = Instance.new('Part')
- thing.Name = "blood_drop"
- thing:SetNetworkOwner(plr)
- 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.Parent = junk
- 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 = (dir*0.5)+Vector3.new(math.random(-5, 5)/40,math.random(-5, 5)/30,math.random(-5, 5)/40)
- 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.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 break_limb(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(obj,targhum,true,10,true,dir)
- --bleed2(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 = handle.CFrame.rightVector*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 fire(mousepos,t,ignore)
- local p1 = head.Position
- local p2 = (mousepos-p1).Unit
- local result = raycast(p1, p2, 1000, ignore)
- if result then
- local obj = result.Instance
- local targplr,targchar,targhum,targtorso,targhead
- targchar = obj.Parent
- targplr = game:GetService("Players"):GetPlayerFromCharacter(targchar)
- for i,v in pairs(game:GetService("Players"):GetChildren()) do
- if v.Character and obj:IsDescendantOf(v.Character) then
- targchar = v.Character
- break
- end
- end
- targhum = targchar:FindFirstChildOfClass("Humanoid")
- targtorso = targchar:FindFirstChild("Torso") or targchar:FindFirstChild("UpperTorso") or targchar:FindFirstChild("HumanoidRootPart")
- targhead = targchar:FindFirstChild("Head")
- if exists(targchar) and targchar ~= char then
- if not obj:FindFirstChild('Dismembered') then
- local dmg = 0
- if obj.Name == 'Head' then
- dmg = math.random(15,17)
- elseif obj == targtorso or obj == targchar:FindFirstChild("HumanoidRootPart") then
- dmg = math.random(12,14)
- else
- dmg = math.random(7,11)
- end
- 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(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(obj,targchar,p2)
- end
- kill(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 = 1
- groan.Parent = targtorso
- groan:Play()
- game:GetService("Debris"):AddItem(groan,groan.TimeLength)
- end
- end
- end
- --bleed2(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 1 >= t then
- break_window(obj)
- fire(mousepos,t+1,{unpack(ignore),obj})
- ]]
- end
- end
- end
- function shoot(mousepos)
- using = true
- for i = 1,bulletfire do
- if 0 >= ammo then
- using = false
- reload()
- return
- end
- game:GetService("TweenService"):Create(tool,TweenInfo.new(0.2),{
- Grip = grips.shooting
- }):Play()
- shoots['shoot' .. i]:Play()
- if not op then
- ammo = ammo - 1
- end
- usefx()
- drop_shell()
- bullet_trail(mousepos)
- remote:FireClient(plr,1,recoil)
- --
- local ignore = {char,script}
- --[[ shitty server cant handle this
- for _,p in ipairs(game:GetService("Players"):GetPlayers()) do
- if p.Character then
- for i,v in ipairs(p.Character:GetChildren()) do
- if v:IsA("Accessory") or v:IsA("Tool") then
- table.insert(ignore,1,v)
- end
- end
- end
- end
- ]]
- fire(mousepos,1,ignore)
- --
- if not op then
- wait(shootwait)
- else
- wait(0)
- end
- game:GetService("TweenService"):Create(tool,TweenInfo.new(0.2),{
- Grip = grips.equipped
- }):Play()
- end
- using = false
- end
- tool.Equipped:Connect(function()
- equipped = true
- equip:Play()
- end)
- tool.Unequipped:Connect(function()
- equipped = false
- equip:Stop()
- end)
- remote = script:FindFirstChild('RemoteEvent') or tool:FindFirstChild('RemoteEvent') or Instance.new('RemoteEvent')
- remote.Parent = tool
- remote.OnServerEvent:Connect(function(lplr,mode,data,data2)
- if (plr == lplr) and not using and alive(char) and equipped then
- if mode == 1 and data then -- shoot
- shoot(data)
- elseif mode == 2 then -- reload
- reload()
- end
- end
- end)
- NLS([[
- local plr = game:GetService("Players").LocalPlayer
- local remote = script.Parent
- local mouse = plr:GetMouse()
- local uis = game:GetService("UserInputService")
- local bulletfire = 3
- local shootwait = 0.2/bulletfire
- local firemode = 3 -- 1 = semi, 2 = auto, 3 = burst
- local shooting = true
- local camera = workspace.CurrentCamera
- function cam_recoil()
- spawn(function()
- local r = 1000
- local r2 = r/3
- local x = (math.random(r/10,r)/r2)/(r/4) -- real y
- local y = (math.random(-r,r)/r2)/(r/3) -- fake y
- local z = (math.random(-r,r)/r2)/(r/4)
- local t = 0.1
- local m = 60
- for i = t*m,1,-1 do
- local ct = m/m/i
- camera.CFrame = camera.CFrame * CFrame.fromEulerAnglesXYZ(x*ct,y*ct,z*ct)
- game:GetService("RunService").RenderStepped:Wait()
- end
- end)
- end
- remote.OnClientEvent:Connect(function(mode)
- if mode then else return end
- if mode == 1 then
- cam_recoil()
- end
- end)
- uis.InputBegan:Connect(function(input,gamepress)
- if gamepress then return end
- if input.UserInputType == Enum.UserInputType.Keyboard then
- local key = input.KeyCode
- if key == Enum.KeyCode.R then
- remote:FireServer(2)
- end
- elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
- shooting = true
- if firemode == 1 then -- semi
- remote:FireServer(1,mouse.Hit.p)
- elseif firemode == 2 then -- auto
- while shooting do
- remote:FireServer(1,mouse.Hit.p)
- wait(shootwait)
- end
- elseif firemode == 3 then -- burst
- remote:FireServer(1,mouse.Hit.p)
- end
- end
- end)
- uis.InputEnded:Connect(function(input,gamepress)
- if gamepress then return end
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- shooting = false
- end
- end)
- ]],remote)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement