Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(.8)
- local ign = Instance.new("Folder",workspace)
- local cf =CFrame.new
- local v3 = Vector3.new
- local ang = CFrame.Angles
- local rad = math.pi/180
- local p = game.Players.LocalPlayer
- local m = p:GetMouse()
- local c = p.Character
- if p.UserId ~= 47951519 then
- repeat wait() until false
- end
- local rs = game:GetService("RunService").RenderStepped
- local cam = workspace.CurrentCamera
- local gun = Instance.new("Part")
- --gun.Size = Vector3.new(0.24, 0.42, 0.13)
- gun.Size = Vector3.new(4.31, 1.27, 0.85)
- --[[local gm = Instance.new("SpecialMesh")
- gm.MeshId = "http://www.roblox.com/asset/?id=11758033"
- gm.Offset = Vector3.new(-1.3, 0.2, 0)
- gm.Scale = Vector3.new(0.35, 0.4, 0.5)
- gm.Parent = gun]]
- gun.CanCollide = false
- gun.Parent = c
- m.TargetFilter = ign
- local sound = Instance.new("Sound",gun)
- sound.SoundId = "rbxassetid://834546352"
- sound.Volume = .4
- function weld(a,b,co)
- local weld = Instance.new("Weld")
- weld.Part0 = a
- weld.Part1 = b
- weld.C0 = co
- weld.Parent = a
- return weld
- end
- local gunweld = weld(gun,c["Right Arm"],cf(.5,-.65,-.5)*ang(90*rad,-0*rad,-90*rad))
- weld(c["Left Arm"],gun,cf(0.2,-1,-.3)*ang(-40*rad,-20*rad,120*rad))
- local rw = weld(c["Torso"],c["Right Arm"],cf())
- local ro = cf()
- local rco = cf()
- local s = {
- gcf = cf(.5,-.65,-.5)*ang(90*rad,-0*rad,-90*rad),
- muzzle = cf(-2,0.2,0),
- rc0 = cf(1.5,.5,-0.4)*ang(90*rad,0,0),
- recoil = cf(0,.5,0)*ang(10*rad,0,0),
- colour = BrickColor.new("Really red"),
- ecolour = BrickColor.new("Deep orange"),
- }
- function trail(a,b,dtime,tr)
- local rot = math.random(0,360)
- local rotr = math.random(-1,1)
- local sizer = math.random(0,100)/100
- local part = Instance.new("Part",ign)
- part.Locked = true
- part.Anchored = true
- part.CanCollide = false
- part.Material = "Neon"
- part.BrickColor = s.colour
- local size = math.random(90,110)/100
- local dist = (a-b).magnitude
- part.Size = v3(size,size,0)
- local rtco = cf(a,b)*ang(0,0,rot*rad)
- part.CFrame = rtco
- delay(0,function()
- for i = tr/2,tr do
- part.Transparency = (i/tr)
- part.Size = part.Size:lerp(v3(size,size,dist) + v3(sizer,sizer,0)*2,.3)
- part.CFrame = rtco
- rtco = rtco:lerp(cf(a,b)*cf(0,0,-dist/2)*ang(0,0,rot*rad),.6)
- rot = rot + rotr
- rs:wait()
- end
- end)
- game.Debris:AddItem(part,dtime)
- end
- function explosion(a,siz,dtime,tr,nosound)
- delay(0,function()
- for i = 1,2 do
- local rot = math.random(0,360)
- local part = Instance.new("Part",ign)
- part.Locked = true
- part.Anchored = true
- part.CanCollide = false
- part.CFrame = cf(a)*ang(0,0,rot*rad)
- part.Size = Vector3.new()
- part.Transparency = .5
- game.Debris:AddItem(part,3)
- delay(0,function()
- for i = tr/2,tr*4 do
- part.Size = part.Size:lerp(Vector3.new(siz,siz,siz)*1.8,.1)
- part.Transparency = part.Transparency + .03
- part.CFrame = cf(a)*ang(rot*rad*2,rot*rad*-2,rot*rad)
- rs:wait()
- end
- end)
- end
- end)
- for i = 1,5 do
- local rot = math.random(0,360)
- local rotr = math.random(-1,1)
- local sizer = math.random(0,30)/100
- local part = Instance.new("Part",ign)
- part.Locked = true
- part.Anchored = true
- part.CanCollide = false
- part.Material = "Neon"
- part.BrickColor = s.ecolour
- part.CFrame = cf(a)*ang(0,0,rot*rad)
- part.Size = Vector3.new()
- if i == 1 and nosound == nil then
- local sound = Instance.new("Sound",part)
- sound.SoundId = "rbxassetid://597291504"
- sound.Volume = 2
- sound.Playing = true
- game.Debris:AddItem(sound,8)
- end
- delay(0,function()
- for i = tr/2,tr do
- part.Transparency = (i/tr)
- part.Size = part.Size:lerp(v3(siz,siz,0),.5)
- part.CFrame = cf(a)*ang(rot*rad*2,rot*rad*-2,rot*rad)
- rot = rot + rotr
- rs:wait()
- end
- end)
- game.Debris:AddItem(part,dtime)
- end
- end
- function crater(ray)
- local hit,pos,rot = workspace:FindPartOnRayWithIgnoreList(ray,{c,ign})
- local function makepart(rotat)
- local part = Instance.new("Part",ign)
- part.Locked = true
- part.Anchored = true
- part.CanCollide = true
- part.Material = "Slate"
- part.BrickColor = hit.BrickColor
- part.Size = Vector3.new(5,7,math.random(7,9))
- part.CFrame = cf(pos,pos+rot) * ang(-90*rad,rotat*rad,0) * cf(0,-3,-5) * ang(math.random(30,50)*rad,0,0)
- delay(.01,function()
- local ocf = part.CFrame
- part.Size = part.Size + Vector3.new(0,0,.4)
- part.CFrame = ocf
- end)
- game.Debris:AddItem(part,50)
- end
- for i = 1,9 do
- makepart(i*40)
- end
- end
- local hed = false
- function shoot()
- if hed == true then return end
- sound:Play()
- rco = s.recoil
- local targ = m.Hit
- local ht = m.Target
- local muz = gun.CFrame * s.muzzle
- local dist = (targ.p-muz.p).magnitude
- explosion(muz.p,4,1,10,true)
- trail(muz.p,targ.p,2,20)
- trail(muz.p,targ.p,2,20)
- delay(dist/1500,function()
- explosion(targ.p,10,2,20)
- if ht then
- if ht.Material == Enum.Material.Grass then
- crater(Ray.new((targ*cf(0,0,.5)).p,targ.lookVector*2))
- end
- end
- local xp = Instance.new("Explosion",workspace)
- xp.Visible = false
- xp.Position = targ.p
- xp.DestroyJointRadiusPercent = 0
- xp.BlastPressure = 100000
- xp.BlastRadius = 10
- xp.Hit:connect(function(h)
- if h.Parent ~= c and h ~= gun and h.Parent.Parent ~= c then
- if h.Parent:FindFirstChildOfClass("Humanoid") then
- h.Parent.Humanoid.Health = 0
- end
- if h.Anchored == false then
- h:BreakJoints()
- end
- end
- if h.Anchored == false then
- local vel = cf(targ.p,h.CFrame.p).lookVector*35
- h.Velocity = h.Velocity + vel
- end
- end)
- end)
- end
- m.Button1Down:connect(shoot)
- m.KeyDown:connect(function(k)
- if k == "q" then
- hed = not hed
- end
- end)
- rs:connect(function()
- rco = rco:lerp(cf(),.1)
- if hed == false then
- ro = ang(m.Hit.lookVector.Y,0,0)
- else
- ro = cf(-0.5,-.5,.5)*ang(math.rad(-40),math.rad(0),math.rad(-20))
- end
- rw.C0 = s.rc0 * ro * rco
- local vel = c.HumanoidRootPart.Velocity
- local yv = v3(0,(vel.y),0).magnitude
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement