Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- All code written by -UN?D-HeadShot
- -- Effect settings
- SWEP.PrintName = "Popcorn" --
- SWEP.Slot = 1 --
- SWEP.SlotPos = 1 --
- SWEP.DrawAmmo = false --
- SWEP.DrawCrosshair = false --
- SWEP.ViewModel = "models/popcorn.mdl" --
- SWEP.WorldModel = "models/popcorn.mdl" --
- SWEP.ReloadSound = "clipin.wav" --
- -- Other settings
- SWEP.HoldType = "physgun"
- SWEP.Weight = 1 --
- SWEP.AutoSwitchTo = true --
- SWEP.AutoSwitchFrom = false --
- SWEP.Spawnable = true --
- SWEP.AdminSpawnable = true --
- --SWEP.AutoReload = true --
- -- Weapon info
- SWEP.Author = "Maxsnipez" --
- SWEP.Contact = "maxwlang@me.com" --
- SWEP.Purpose = "" --
- SWEP.Instructions = "" --
- -- Primary fire settings
- SWEP.Primary.Sound = "" --
- SWEP.Primary.Damage = 0 --
- SWEP.Primary.NumShots = 0 --
- SWEP.Primary.Recoil = 0 --
- SWEP.Primary.Cone = 0 --
- SWEP.Primary.Delay = 0 --
- SWEP.Primary.ClipSize = 0 --
- SWEP.Primary.DefaultClip = 0 --
- SWEP.Primary.Tracer = 0 --
- SWEP.Primary.Force = 0 --
- SWEP.Primary.TakeAmmoPerBullet = false --
- SWEP.Primary.Automatic = false --
- SWEP.Primary.Ammo = "" -- --
- -- Secondary fire settings
- SWEP.Secondary.Sound = "" --
- SWEP.Secondary.Damage = 0 --
- SWEP.Secondary.NumShots = 0 --
- SWEP.Secondary.Recoil = 0 --
- SWEP.Secondary.Cone = 0 --
- SWEP.Secondary.Delay = 0 --
- SWEP.Secondary.ClipSize = 0 --
- SWEP.Secondary.DefaultClip = 0 --
- SWEP.Secondary.Tracer = 0 --
- SWEP.Secondary.Force = 0 --
- SWEP.Secondary.TakeAmmoPerBullet = true --
- SWEP.Secondary.Automatic = false --
- SWEP.Secondary.Ammo = "" -- --
- SWEP.Object = "" --
- SWEP.ObjectExplode = false --
- SWEP.ObjectForce = 2500
- --
- --
- function SWEP:Initialize() --
- self:SetWeaponHoldType( self.HoldType )
- end
- function SWEP:PrimaryAttack() --
- if ( !self:CanPrimaryAttack() ) then return end --
- self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) --
- self.Owner:MuzzleFlash() --
- self.Owner:SetAnimation( PLAYER_ATTACK1 ) --
- self.Weapon:EmitSound(Sound(self.Primary.Sound)) --
- self.Owner:ViewPunch(Angle( -self.Primary.Recoil, 0, 0 ))
- if ( SERVER ) then
- object = ents.Create("prop_physics")
- object:SetKeyValue("physdamagescale","500")
- if (self.ObjectExplode) then
- object:SetKeyValue("explodedamage","25")
- object:SetKeyValue("health","500")
- object:SetKeyValue("exploderadius","150")
- object:SetKeyValue("physdamagescale","1500")
- --object:SetColor(255,255,255,255)
- end
- object:SetModel(self.Object)
- object:SetOwner(self.Owner)
- object:SetPos(self.Owner:GetShootPos())
- object:SetAngles(self.Owner:GetAimVector())
- object:Spawn()
- local physobj = object:GetPhysicsObject()
- local force = self.ObjectForce * physobj:GetMass()
- physobj:SetVelocity(self.Owner:GetAimVector() * force)
- undo.Create("Launched prop")
- undo.AddEntity(object)
- undo.SetPlayer(self.Owner)
- undo.Finish()
- end
- self:TakePrimaryAmmo(1)
- self:SetNextPrimaryFire( CurTime() + self.Primary.Delay ) --
- end
- function SWEP:SecondaryAttack() -- Called when we press secondary fire
- if ( !self:CanSecondaryAttack() ) then return end --
- self.Weapon:SendWeaponAnim( ACT_VM_SECONDARYATTACK ) --
- self.Owner:MuzzleFlash() --
- self.Owner:SetAnimation( PLAYER_ATTACK1 ) --
- self.Weapon:EmitSound(Sound(self.Secondary.Sound)) --
- self.Owner:ViewPunch(Angle( -self.Secondary.Recoil, 0, 0 ))
- if ( SERVER ) then
- object = ents.Create("prop_physics")
- object:SetKeyValue("physdamagescale","500")
- if (self.ObjectExplode) then
- object:SetKeyValue("explodedamage","25")
- object:SetKeyValue("health","500")
- object:SetKeyValue("exploderadius","150")
- object:SetKeyValue("physdamagescale","1500")
- --object:SetColor(255,255,255,255)
- end
- object:SetModel(self.Object)
- object:SetOwner(self.Owner)
- object:SetPos(self.Owner:GetShootPos())
- object:SetAngles(self.Owner:GetAimVector())
- object:Spawn()
- local physobj = object:GetPhysicsObject()
- local force = self.ObjectForce * physobj:GetMass()
- physobj:SetVelocity(self.Owner:GetAimVector() * force)
- undo.Create("Launched prop")
- undo.AddEntity(object)
- undo.SetPlayer(self.Owner)
- undo.Finish()
- end
- self:TakeSecondaryAmmo(1)
- self:SetNextSecondaryFire( CurTime() + self.Secondary.Delay ) --
- end
- function SWEP:Think() --
- end
- function SWEP:Reload() --
- if (self.Weapon:DefaultReload()) then return end --
- self.Weapon:DefaultReload( ACT_VM_RELOAD ) --
- self.Weapon:EmitSound(Sound(self.ReloadSound)) --
- end
- function SWEP:Deploy() --
- self.Weapon:SendWeaponAnim(ACT_VM_DRAW)
- return true
- end
- function SWEP:Holster() --
- return true
- end
- function SWEP:OnRemove() --
- end
- function SWEP:OnRestore() --
- end
- function SWEP:Precache() --
- end
- function SWEP:OwnerChanged() --
- end
- function SWEP:ContextScreenClick( aimvec, mousecode, pressed, ply ) --
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement