Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local blacklist = {}
- local shot = Instance.new("Sound")
- shot.SoundId = "rbxassetid://5773418559"
- shot.TimePosition = 0
- shot.Volume = 1
- local click = Instance.new("Sound")
- click.SoundId = "rbxassetid://134188543"
- click.TimePosition = 0.6
- click.PlayOnRemove = true
- click.Volume = 2
- e = Instance.new("RemoteEvent",owner.Character)
- local hed = Instance.new("Weld",owner.Character.Torso)
- hed.Part0 = owner.Character.Head
- hed.Part1 = hed.Parent
- hed.C0 = CFrame.new(0,-0.5,0)
- hed.C1 = CFrame.new(0,1,0)
- hed.Enabled = false
- local tool = Instance.new("Tool",owner.Backpack)
- tool.Grip = CFrame.new(0.2,-0.2,0.5) * CFrame.Angles(math.rad(-1),math.rad(-2),0)
- tool.Name = "shotgu"
- local armw = Instance.new("Weld",owner.Character.Torso)
- armw.Part0 = owner.Character["Right Arm"]
- armw.Part1 = owner.Character.Torso
- armw.C1 = CFrame.new(1.5,0.1,0.25)
- armw.Enabled = false
- armw.C0 = CFrame.new(0,0.5,0) * CFrame.Angles(math.rad(-90),0,0)
- local part = Instance.new("Part",tool)
- part.Name = "Handle"
- part.Size = Vector3.new(6.883,11.953,33.644) * 0.15
- local m = Instance.new("SpecialMesh",part)
- m.MeshId = "rbxassetid://10522415276"
- m.TextureId = "rbxassetid://10522448627"
- m.Scale = Vector3.new(1,1,1) * 0.084375
- local part2 = Instance.new("Part",tool)
- part2.CanCollide = false
- part2.Size = Vector3.new(6.883,11.953,33.644) * 0.15
- local m2 = Instance.new("SpecialMesh",part2)
- m2.MeshId = "rbxassetid://10522416072"
- m2.TextureId = "rbxassetid://10522448627"
- m2.Scale = Vector3.new(1,1,1) * 0.084375
- local part3 = Instance.new("Part",tool)
- part3.CanCollide = false
- part3.Size = Vector3.new(6.883,11.953,33.644) * 0.15
- local m3 = Instance.new("SpecialMesh",part3)
- m3.MeshId = "rbxassetid://10522415608"
- m3.TextureId = "rbxassetid://10522448627"
- m3.Scale = Vector3.new(1,1,1) * 0.084375
- local weld2 = Instance.new("Weld",part)
- weld2.Part0 = part3
- weld2.Part1 = part
- weld2.C1 = CFrame.new(0,0.675,0.1)
- local weld = Instance.new("Weld",part3)
- weld.Part0 = part2
- weld.Part1 = part3
- weld.C1 = CFrame.new(0,0.65,-1.75) * CFrame.new(0,-0.675,-0.1)
- local part4 = Instance.new("Part",tool)
- part4.CanCollide = false
- part4.Size = Vector3.new(6.883,11.953,33.644) * 0.15
- local m4 = Instance.new("SpecialMesh",part4)
- m4.MeshId = "rbxassetid://10522417111"
- m4.TextureId = "rbxassetid://10522448627"
- m4.Scale = Vector3.new(1,1,1) * 0.084375
- local weld3 = Instance.new("Weld",part3)
- weld3.Part0 = part4
- weld3.Part1 = part3
- weld3.C1 = CFrame.new(0,0.575,-1.9) * CFrame.new(0,-0.675,-0.1)
- local tweenService = game:GetService("TweenService")
- local tweenInfo = TweenInfo.new(0.15,Enum.EasingStyle.Back,Enum.EasingDirection.Out,0,false)
- local goal = {}
- goal.C0 = CFrame.new(0,-0.5,-0.7) * CFrame.Angles(math.rad(-115),0,0)
- local tween = tweenService:Create(armw, tweenInfo, goal)
- local tweenInfo = TweenInfo.new(0.25,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false)
- local goal2 = {}
- goal2.C0 = CFrame.new(0,0.1,-0.2) * CFrame.Angles(math.rad(-110),math.rad(-5),math.rad(-5))
- local tween2 = tweenService:Create(armw, tweenInfo, goal2)
- local tweenInfo = TweenInfo.new(0.15,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,true)
- local goal3 = {}
- goal3.C0 = CFrame.new(0,0,-1.2)
- local tween3 = tweenService:Create(weld3, tweenInfo, goal3)
- local tweenInfo = TweenInfo.new(0.15,Enum.EasingStyle.Back,Enum.EasingDirection.InOut,0,true)
- local goa = {}
- goa.C0 = CFrame.new(0,0,-0.3) * CFrame.Angles(math.rad(-109),math.rad(-4),math.rad(-4))
- local tweenn = tweenService:Create(armw, tweenInfo, goa)
- local tweenInfo = TweenInfo.new(0.15,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false)
- local goal4 = {}
- goal4.C0 = CFrame.new(0,0.5,0) * CFrame.Angles(math.rad(-90),0,0)
- local tween4 = tweenService:Create(armw, tweenInfo, goal4)
- local tweenInfo = TweenInfo.new(0.15,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,true)
- local goa = {}
- goa.C0 = owner.Character.HumanoidRootPart:FindFirstChildWhichIsA("Motor6D").C0 * CFrame.Angles(math.rad(-5),0,0)
- local twee = tweenService:Create(owner.Character.HumanoidRootPart:FindFirstChildWhichIsA("Motor6D"), tweenInfo, goa)
- tween.Completed:Connect(function()
- tween2:Play()
- end)
- tween2.Completed:Connect(function()
- tween3:Play()
- tweenn:Play()
- end)
- tween3.Completed:Connect(function()
- tween4:Play()
- end)
- local db = false
- shot.Ended:Connect(function()
- shot.Parent = nil
- end)
- tween4.Completed:Connect(function()
- db = false
- end)
- tool.Activated:Connect(function()
- if not db then
- db = true
- tween:Play()
- twee:Play()
- shot.TimePosition = 0
- shot.Parent = part
- shot:Play()
- coroutine.wrap(function()
- local TimeToTake = 0.4
- local Accumulated = 0
- while TimeToTake > Accumulated do
- Accumulated += game:GetService("RunService").Heartbeat:Wait()
- end
- click.Parent = part
- click.Parent = nil
- end)()
- local look = {CFrame.Angles(owner.Character.Head.CFrame:ToEulerAnglesXYZ()) * CFrame.Angles(math.rad(-2),math.rad(-2),0);
- CFrame.Angles(owner.Character.Head.CFrame:ToEulerAnglesXYZ()) * CFrame.Angles(math.rad(-3),math.rad(0),0);
- CFrame.Angles(owner.Character.Head.CFrame:ToEulerAnglesXYZ()) * CFrame.Angles(math.rad(-2),math.rad(2),0);
- CFrame.Angles(owner.Character.Head.CFrame:ToEulerAnglesXYZ()) * CFrame.Angles(math.rad(0),math.rad(-3),0);
- CFrame.Angles(owner.Character.Head.CFrame:ToEulerAnglesXYZ());
- CFrame.Angles(owner.Character.Head.CFrame:ToEulerAnglesXYZ()) * CFrame.Angles(math.rad(0),math.rad(3),0);
- CFrame.Angles(owner.Character.Head.CFrame:ToEulerAnglesXYZ()) * CFrame.Angles(math.rad(2),math.rad(-2),0);
- CFrame.Angles(owner.Character.Head.CFrame:ToEulerAnglesXYZ()) * CFrame.Angles(math.rad(3),math.rad(0),0);
- CFrame.Angles(owner.Character.Head.CFrame:ToEulerAnglesXYZ()) * CFrame.Angles(math.rad(2),math.rad(2),0)}
- for i = 1, 9 do
- coroutine.wrap(function()
- look[i] = look[i] * CFrame.Angles(math.rad(math.random(-4,4)/5),math.rad(math.random(-4,4)/5),0)
- local shootybang
- local bullet = Instance.new("Part",script)
- bullet.Size = Vector3.new(0.25,0.25,10)
- bullet.CanCollide = false
- bullet.Anchored = true
- bullet.Color = Color3.fromRGB(200,200,200)
- bullet.Material = "Neon"
- table.insert(blacklist,bullet)
- local a1 = Instance.new("Attachment",bullet)
- a1.CFrame = CFrame.new(0,-0.1,10)
- local a2 = Instance.new("Attachment",bullet)
- a2.CFrame = CFrame.new(0,0.1,10)
- local t = Instance.new("Trail",bullet)
- t.Attachment0 = a1
- t.Attachment1 = a2
- t.Color = ColorSequence.new(bullet.Color)
- t.WidthScale = NumberSequence.new{NumberSequenceKeypoint.new(0,1),NumberSequenceKeypoint.new(1,0)}
- t.Lifetime = 0.1
- t.MaxLength = 10
- t.MinLength = 0.1
- t.LightEmission = 0.2
- t.LightInfluence = 0.5
- t.TextureLength = 1
- t.TextureMode = "Stretch"
- t.WidthScale = NumberSequence.new{NumberSequenceKeypoint.new(0, 1),NumberSequenceKeypoint.new(1, 0)}
- t.FaceCamera = true
- Instance.new("SpecialMesh",bullet).MeshType = "Sphere"
- bullet.CFrame = CFrame.new((part.CFrame * CFrame.new(0,0,2)).Position) * CFrame.Angles(part.CFrame:ToEulerAnglesXYZ())
- local params = RaycastParams.new()
- params.FilterDescendantsInstances = {script,bullet,owner.Character,blacklist}
- params.FilterType = Enum.RaycastFilterType.Blacklist
- local sped = 30
- local oghedcf = owner.Character.Head.CFrame
- local c = 0
- shootybang = game:GetService("RunService").Stepped:Connect(function(_,b)
- local res
- c = c + 1
- if c ~= 2 then
- res = workspace:Raycast(bullet.Position, bullet.CFrame.lookVector*((sped)*b*15), params)
- else
- bullet.CFrame = (CFrame.new(oghedcf.Position) * CFrame.Angles(look[i]:ToEulerAnglesXYZ())) * CFrame.new(0,0,(-sped + (15*b))*b*15)
- res = workspace:Raycast(bullet.Position, bullet.CFrame.lookVector*((sped)*b*15), params)
- end
- if not res then
- bullet.CFrame = bullet.CFrame * CFrame.new(0,0,(-sped)*b*15)
- sped = sped - (15*b)
- bullet.Size = Vector3.new(0.25,0.25,sped)
- a2.CFrame = CFrame.new(0,0.1,sped)
- a1.CFrame = CFrame.new(0,-0.1,sped)
- if sped < 0 then
- bullet:Destroy()
- shootybang:Disconnect()
- end
- else
- if res.Instance:FindFirstAncestorWhichIsA("Model") and res.Instance:FindFirstAncestorWhichIsA("Model"):FindFirstChild("Humanoid") then
- res.Instance:FindFirstAncestorWhichIsA("Model"):FindFirstChild("Humanoid").Health -= 45
- bullet:Destroy()
- shootybang:Disconnect()
- else
- bullet:Destroy()
- shootybang:Disconnect()
- end
- end
- end)
- end)()
- end
- end
- end)
- local equip = Instance.new("Sound")
- equip.PlayOnRemove = true
- equip.Volume = 1
- equip.SoundId = "rbxassetid://6870002623"
- tool.Equipped:Connect(function()
- equip.Parent = part
- equip.Parent = nil
- end)
- tool.Equipped:Connect(function()
- armw.Enabled = true
- hed.Enabled = true
- end)
- tool.Unequipped:Connect(function()
- armw.Enabled = false
- hed.Enabled = false
- end)
- e.OnServerEvent:Connect(function(_,cam,c1,alpha,hitcf,sw,wcs,shift)
- local lookvector = owner.Character.HumanoidRootPart.CFrame:toObjectSpace(cam).lookVector.unit
- hed.C0 = hed.C0:Lerp(CFrame.new(0,-0.5,0) * CFrame.Angles(-lookvector.y,0,0),0.5)
- hed.C0 = hed.C0 * CFrame.Angles(sw.y,0,0)
- if shift then
- if lookvector.y > 0 then
- armw.C1 = armw.C1:Lerp(CFrame.new(1.5,0.1,0) * CFrame.Angles(lookvector.y + sw.y,-(sw.x),0) * CFrame.new(0,-lookvector.y,-0.5 * lookvector.y),0.5)
- armw.C1 = armw.C1:Lerp(armw.C1 * CFrame.new(wcs.y / 2, wcs.x / 2,0),0.25)
- else
- armw.C1 = armw.C1:Lerp(CFrame.new(1.5,0.1,0) * CFrame.Angles(lookvector.y + sw.y,-(sw.x),0) * CFrame.new(0,0.5 * lookvector.y,-1.5 * lookvector.y),0.5)
- armw.C1 = armw.C1:Lerp(armw.C1 * CFrame.new(wcs.y / 2, wcs.x / 2,0),0.25)
- end
- else
- if lookvector.y > 0 then
- armw.C1 = armw.C1:Lerp(CFrame.new(1.5,0.1,0) * CFrame.Angles(lookvector.y + sw.y,0,0) * CFrame.new(0,-lookvector.y,-0.5 * lookvector.y),0.5)
- armw.C1 = armw.C1:Lerp(armw.C1 * CFrame.new(wcs.y / 2, wcs.x / 2,0),0.25)
- else
- armw.C1 = armw.C1:Lerp(CFrame.new(1.5,0.1,0) * CFrame.Angles(lookvector.y + sw.y,0,0) * CFrame.new(0,0.5 * lookvector.y,-1.5 * lookvector.y),0.5)
- armw.C1 = armw.C1:Lerp(armw.C1 * CFrame.new(wcs.y / 2, wcs.x / 2,0),0.25)
- end
- end
- end)
- NLS([[
- e = script.Parent
- local tool = owner.Backpack:WaitForChild("shotgu")
- eq = false
- tool.Equipped:Connect(function()
- eq = true
- end)
- tool.Unequipped:Connect(function()
- eq = false
- end)
- local ITERATIONS = 8
- local SPRING = {}
- function SPRING.create(self, mass, force, damping, speed)
- local spring = {
- Target = Vector3.new();
- Position = Vector3.new();
- Velocity = Vector3.new();
- Mass = mass or 5;
- Force = force or 50;
- Damping = damping or 4;
- Speed = speed or 4;
- }
- function spring.shove(self, force)
- local x, y, z = force.X, force.Y, force.Z
- if x ~= x or x == math.huge or x == -math.huge then
- x = 0
- end
- if y ~= y or y == math.huge or y == -math.huge then
- y = 0
- end
- if z ~= z or z == math.huge or z == -math.huge then
- z = 0
- end
- self.Velocity = self.Velocity + Vector3.new(x, y, z)
- end
- function spring.update(self, dt)
- local scaledDeltaTime = math.min(dt,1) * self.Speed / ITERATIONS
- for i = 1, ITERATIONS do
- local iterationForce = self.Target - self.Position
- local acceleration = (iterationForce * self.Force) / self.Mass
- acceleration = acceleration - (self.Velocity * self.Damping)
- self.Velocity = self.Velocity + (acceleration * scaledDeltaTime)
- self.Position = self.Position + (self.Velocity * scaledDeltaTime)
- end
- return self.Position
- end
- return spring
- end
- local wc = SPRING.create()
- local sway = SPRING.create()
- local bobspeed = 1
- local bobmod = .1
- local alpha = .25
- local hitcf = CFrame.new()
- local function gb(addition, speed, modifier)
- return math.sin(tick() * addition * speed) * modifier
- end
- c1 = CFrame.new(0,0,0)
- c2 = CFrame.new(0,0,0)
- local UIS = game:GetService("UserInputService")
- shift = false
- UIS:GetPropertyChangedSignal("MouseBehavior"):Connect(function()
- if UIS.MouseBehavior == Enum.MouseBehavior.LockCenter then
- shift = true
- elseif UIS.MouseBehavior ~= Enum.MouseBehavior.LockCenter then
- shift = false
- end
- end)
- game:GetService("RunService").RenderStepped:Connect(function(dt)
- if eq then
- delta = game:GetService("UserInputService"):GetMouseDelta()
- local vel = owner.Character.HumanoidRootPart.Velocity
- local msway = Vector3.new(gb(10, bobspeed, bobmod), gb(5, bobspeed, bobmod), gb(5, bobspeed, bobmod))
- sway:shove(Vector3.new(delta.X / 500, delta.Y / 500))
- wc:shove((msway / 25) * dt * 60 * math.clamp(vel.Magnitude,0,30))
- local sw = sway:update(dt)
- local wcs = wc:update(dt)
- e:FireServer(workspace.CurrentCamera.CFrame,c1,alpha,hitcf,sw,wcs,shift)
- end
- end)
- ]],e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement