Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- MeshPart1 = Instance.new("MeshPart")
- Sound2 = Instance.new("Sound")
- Script3 = Instance.new("Script")
- LocalScript4 = Instance.new("LocalScript")
- RemoteFunction5 = Instance.new("RemoteFunction")
- Part6 = Instance.new("Part")
- WeldConstraint7 = Instance.new("WeldConstraint")
- Script8 = Instance.new("Script")
- LocalScript9 = Instance.new("LocalScript")
- RemoteFunction10 = Instance.new("RemoteFunction")
- Tool0.Name = "M16"
- Tool0.Parent = mas
- Tool0.CanBeDropped = false
- Tool0.Grip = CFrame.new(-1, -0.100000001, 0, 0, 0, -1, -1, 0, 0, 0, 1, 0)
- Tool0.GripForward = Vector3.new(1, -0, -0)
- Tool0.GripPos = Vector3.new(-1, -0.100000001, 0)
- Tool0.GripRight = Vector3.new(0, -1, 0)
- Tool0.GripUp = Vector3.new(0, 0, 1)
- MeshPart1.Name = "Handle"
- MeshPart1.Parent = Tool0
- MeshPart1.CFrame = CFrame.new(-19.7733021, 1.20430827, -770.653015, -4.37113883e-08, -1, 0, -4.37113883e-08, 1.91068547e-15, 1, -1, 4.37113883e-08, -4.37113883e-08)
- MeshPart1.Orientation = Vector3.new(-90, 90, 0)
- MeshPart1.Position = Vector3.new(-19.7733021, 1.20430827, -770.653015)
- MeshPart1.Rotation = Vector3.new(-90, 0, 90)
- MeshPart1.Size = Vector3.new(7.03528309, 0.635280371, 2.32869124)
- MeshPart1.CanCollide = false
- MeshPart1.TextureID = "rbxassetid://450215258"
- Sound2.Name = "M16 Shot [Free]"
- Sound2.Parent = MeshPart1
- Sound2.SoundId = "rbxassetid://151997297"
- Script3.Name = "Handler"
- Script3.Parent = Tool0
- table.insert(cors,sandbox(Script3,function()
- Player = script.Parent.Parent.Parent
- Character=Player.Character
- hitev = script.Hit
- local mouse=Player:GetMouse()
- active = false
- NLS([[
- ]],Player)
- function rayCast(Pos, Dir, Max, Ignore)
- local ig = workspace.ignoreFolder:GetChildren()
- table.insert(ig,0,script.Parent.Handle)
- table.insert(ig,0,script.Parent.FirePart)
- return game:service("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Pos, Dir.unit * (Max or 5000)), ig)
- end
- function nooutline(part)
- part.TopSurface,part.BottomSurface,part.LeftSurface,part.RightSurface,part.FrontSurface,part.BackSurface = 10,10,10,10,10,10
- end
- function part(formfactor,parent,material,reflectance,transparency,brickcolor,name,size)
- local fp=Instance.new("Part")
- fp.formFactor=formfactor
- fp.Parent=parent
- fp.Reflectance=reflectance
- fp.Transparency=transparency
- fp.CanCollide=false
- fp.Locked=true
- fp.BrickColor=BrickColor.new(tostring(brickcolor))
- fp.Name=name
- fp.Size=size
- fp.Position=Player.Character.Torso.Position
- nooutline(fp)
- fp.Material=material
- fp:BreakJoints()
- return fp
- end
- function mesh(Mesh,part,meshtype,meshid,offset,scale)
- local mesh=Instance.new(Mesh)
- mesh.Parent=part
- if Mesh=="SpecialMesh" then
- mesh.MeshType=meshtype
- mesh.MeshId=meshid
- end
- mesh.Offset=offset
- mesh.Scale=scale
- return mesh
- end
- function swait(num)
- if num==0 or num==nil then
- game:service'RunService'.Heartbeat:wait(0)
- else
- for i=0,num do
- game:service'RunService'.Heartbeat:wait(0)
- end
- end
- end
- vt=Vector3.new
- cf=CFrame.new
- euler=CFrame.fromEulerAnglesXYZ
- angles=CFrame.Angles
- function MagicCylinder(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
- local prt=part(3,workspace.ignoreFolder,"Neon",0,0,brickcolor,"Effect",vt(0.2,0.2,0.2))
- prt.Anchored=true
- prt.CFrame=cframe
- local msh=mesh("SpecialMesh",prt,"Head","",vt(0,0,0),vt(x1,y1,z1))
- game:GetService("Debris"):AddItem(prt,2)
- coroutine.resume(coroutine.create(function(Part,Mesh)
- for i=0,1,delay do
- swait()
- Part.CFrame=Part.CFrame
- Part.Transparency=i
- Part.Scale=Part.Scale+vt(x3,y3,z3)
- end
- Part.Parent=nil
- end),prt,msh)
- end
- function MagicPart(brickcolor,cframe,x1,y1,z1,x3,y3,z3,delay)
- local prt=part(3,workspace.ignoreFolder,"Neon",0,0,brickcolor,"Effect",vt())
- prt.Anchored=true
- prt.CFrame=cframe
- local msh=mesh("BlockMesh",prt,"","",vt(0,0,0),vt(x1,y1,z1))
- game:GetService("Debris"):AddItem(prt,2)
- coroutine.resume(coroutine.create(function(Part,Mesh)
- for i=0,1,delay do
- swait()
- Part.CFrame=Part.CFrame
- Part.Transparency=i
- Mesh.Scale=Mesh.Scale+vt(x3,y3,z3)
- end
- Part.Parent=nil
- end),prt,msh)
- end
- attack = false
- function Shoot(Prt,Parent)
- attack=true
- local sfx = script.Parent.Handle["M16 Shot [Free]"]:Clone()
- sfx.Parent=script.Parent
- sfx:Play()
- game:GetService("Debris"):AddItem(sfx,2)
- local efprt=part(3,workspace.ignoreFolder,"Neon",0,0.5,BrickColor.new("Bright green"),"Effect",vt(0.2,0.2,0.2))
- efprt.Anchored=true
- local efmsh=mesh("CylinderMesh",efprt,"","",vt(0,0,0),vt(1,1,1))
- local spread=vt((math.random(-1,0)+math.random())*2,(math.random(-1,0)+math.random())*2,(math.random(-1,0)+math.random())*2)*((Prt.Position-hitev:InvokeClient(Player).Position).magnitude/40)
- coroutine.resume(coroutine.create(function(Part,Mesh,Spreaded)
- game:GetService("Debris"):AddItem(Part,6)
- local TheHit=hitev:InvokeClient(Player).Position
- local MouseLook=cf((Prt.Position+TheHit)/2,TheHit+Spreaded/14)
- local hit,pos = rayCast(Prt.Position,MouseLook.lookVector,2000,Parent)
- local tefprt=part(3,workspace.ignoreFolder,"Neon",0,1,BrickColor.new("Black"),"Effect",vt(0.2,0.2,0.2))
- tefprt.CFrame=cf(pos)
- game:GetService("Debris"):AddItem(tefprt,3)
- Part.CFrame=CFrame.new((Prt.Position+pos)/2,pos)*angles(1.57,0,0)
- if(hit.Parent:FindFirstChild("Enemy")~= nil)then
- if hit.Parent:FindFirstChild("Enemy") ~= nil and hit.Name ~= "Base" and hit.Parent.Name ~= Player.Name then
- hit.Parent:FindFirstChild("Enemy"):TakeDamage(4)
- end
- end
- local mag=(Prt.Position-pos).magnitude
- MagicCylinder(BrickColor.new("Bright yellow"),Part.CFrame,1,mag*5,-0.5,-0.05,0,-0.5,0.05) --really yellow
- end),efprt,efmsh,spread)
- wait(0.05)
- attack = false
- end
- function Shoot3(Prt,Parent)
- local MainPos=Prt.Position
- local TheHit=hitev:InvokeClient(Player).Position
- local MouseLook=cf((Prt.Position+TheHit)/2,TheHit)
- local hit,pos = rayCast(Prt.Position,MouseLook.lookVector,2000,Parent)
- local MainPos=MainPos+(MouseLook.lookVector*10)
- --[[
- local bullet2 = Instance.new("Part",workspace)
- local bodyVel = Instance.new("BodyVelocity",bullet2)
- bullet2.Size = Vector3.new(0.5, 0.5, 22.5)
- bullet2.Position = script.Parent.Handle.Position
- bullet2.CFrame = CFrame.new(script.Parent.Handle.CFrame.p,hitev:InvokeClient(Player).Position)
- bodyVel.Velocity = bullet2.CFrame.LookVector * 1000
- ]]--
- local bullet = game.ReplicatedStorage.Bullet:Clone()
- bullet.Parent = workspace.ignoreFolder
- bullet.Position = script.Parent.Handle.Position
- bullet.CFrame = CFrame.new(script.Parent.Handle.Position,hitev:InvokeClient(Player).Position)
- bullet.Ignore.Value = Player.Character
- game:GetService("Debris"):AddItem(bullet,10)
- end
- script.Parent.Deactivated:Connect(function()
- active = false
- end)
- script.Parent.Equipped:Connect(function()
- local trck = Player.Character.Humanoid:LoadAnimation(game.ServerStorage.Equip16:Clone())
- trck:Play()
- wait(1.5)
- local trck0 = Player.Character.Humanoid:LoadAnimation(Player.Character.Idle)
- trck0:Play()
- trck0:GetMarkerReachedSignal("End"):Connect(function()
- print('A')
- trck0:Play()
- end)
- end)
- script.Parent.Activated:Connect(function()
- if not attack then
- active = true
- repeat
- Shoot3(script.Parent.FirePart)
- until not active
- end
- end)
- end))
- Script3.Disabled = true
- LocalScript4.Name = "Local"
- LocalScript4.Parent = Script3
- table.insert(cors,sandbox(LocalScript4,function()
- q = script.Parent:WaitForChild("Hit")
- plr = script.Parent.Parent.Parent.Parent
- q.OnClientInvoke = function()
- return plr:GetMouse().Hit
- end
- end))
- RemoteFunction5.Name = "Hit"
- RemoteFunction5.Parent = Script3
- Part6.Name = "FirePart"
- Part6.Parent = Tool0
- Part6.CFrame = CFrame.new(-16.3010826, 1.72269416, -770.552185, 1, 0, -1.85062657e-16, 0, 1, 0, -1.85062657e-16, 0, 1)
- Part6.Position = Vector3.new(-16.3010826, 1.72269416, -770.552185)
- Part6.Color = Color3.new(0.105882, 0.164706, 0.207843)
- Part6.Size = Vector3.new(0.0522434749, 0.10971082, 0.0888137147)
- Part6.BottomSurface = Enum.SurfaceType.Smooth
- Part6.BrickColor = BrickColor.new("Black")
- Part6.CanCollide = false
- Part6.Material = Enum.Material.SmoothPlastic
- Part6.TopSurface = Enum.SurfaceType.Smooth
- Part6.brickColor = BrickColor.new("Black")
- WeldConstraint7.Parent = Part6
- WeldConstraint7.Part0 = Part6
- WeldConstraint7.Part1 = MeshPart1
- Script8.Name = "Handler"
- Script8.Parent = Tool0
- table.insert(cors,sandbox(Script8,function()
- Player = script.Parent.Parent.Parent
- Character=Player.Character
- hitev = script.Hit
- local mouse=Player:GetMouse()
- wait(2)
- hum = Player.Character:WaitForChild("Humanoid")
- trck0 = hum:LoadAnimation(Player.Character.Idle0)
- trck = hum:LoadAnimation(game.ServerStorage.Equip16:Clone())
- active = false
- function Shoot3(Prt,Parent)
- local bullet = game.ReplicatedStorage.Bullet:Clone()
- bullet.Position = script.Parent.Handle.Position
- bullet.CFrame = CFrame.new(script.Parent.Handle.Position,hitev:InvokeClient(Player).Position) * CFrame.new(0,0,-4)
- bullet.Ignore.Value = Player.Character
- bullet.Parent = workspace.ignoreFolder
- game:GetService("Debris"):AddItem(bullet,5)
- end
- script.Parent.Deactivated:Connect(function()
- active = false
- end)
- script.Parent.Equipped:Connect(function()
- trck:Play()
- wait(1.5)
- trck0:Play()
- end)
- script.Parent.Unequipped:Connect(function()
- trck0:Stop()
- end)
- script.Parent.Activated:Connect(function()
- active = true
- while active do
- Shoot3(script.Parent.FirePart)
- wait(0.05)
- end
- end)
- end))
- LocalScript9.Name = "Local"
- LocalScript9.Parent = Script8
- table.insert(cors,sandbox(LocalScript9,function()
- q = script.Parent:WaitForChild("Hit")
- plr = script.Parent.Parent.Parent.Parent
- q.OnClientInvoke = function()
- return plr:GetMouse().Hit
- end
- end))
- RemoteFunction10.Name = "Hit"
- RemoteFunction10.Parent = Script8
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game.Players.VarixDog.Backpack
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement