Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*---------------------------------
- Created with buu342s Swep Creator
- ---------------------------------*/
- SWEP.PrintName = "TestWeapon2016"
- SWEP.Author = "Old Bill"
- SWEP.Contact = "oldbillandmedic@gmail.com"
- SWEP.Purpose = "To shoot noobs"
- SWEP.Instructions = "Left click to shoot smg, right click to shoot shotgun."
- SWEP.Category = "Best Guns in GMod"
- SWEP.Spawnable= true
- SWEP.AdminSpawnable= true
- SWEP.AdminOnly = false
- SWEP.ViewModelFOV = 70
- SWEP.ViewModel = "models/weapons/c_pistoltest_gun.mdl"
- SWEP.WorldModel = "models/weapons/w_pistoltest.mdl"
- SWEP.ViewModelFlip = false
- SWEP.AutoSwitchTo = false
- SWEP.AutoSwitchFrom = false
- SWEP.Slot = 2
- SWEP.SlotPos = 1
- SWEP.UseHands = false
- SWEP.HoldType = "Pistol"
- SWEP.FiresUnderwater = true
- SWEP.DrawCrosshair = true
- SWEP.DrawAmmo = true
- SWEP.ReloadSound = "weapons/pistol/pistol_reload1.wav"
- SWEP.Base = "weapon_base"
- SWEP.Primary.Sound = Sound("weapons/pistol/pistol_fire2.wav")
- SWEP.Primary.Damage = 12
- SWEP.Primary.TakeAmmo = 1
- SWEP.Primary.ClipSize = 12
- SWEP.Primary.Ammo = "Pistol"
- SWEP.Primary.DefaultClip = 12
- SWEP.Primary.Spread = 0.1
- SWEP.Primary.NumberofShots = 1
- SWEP.Primary.Automatic = false
- SWEP.Primary.Recoil = 0.5
- SWEP.Primary.Delay = 0.02
- SWEP.Primary.Force = 5
- SWEP.Secondary.ClipSize = 0
- SWEP.Secondary.DefaultClip = 0
- SWEP.Secondary.Automatic = false
- SWEP.Secondary.Ammo = "none"
- SWEP.CSMuzzleFlashes = false
- function SWEP:Initialize()
- util.PrecacheSound(self.Primary.Sound)
- util.PrecacheSound(self.ReloadSound)
- self:SetWeaponHoldType( self.HoldType )
- end
- function SWEP:PrimaryAttack()
- if ( !self:CanPrimaryAttack() ) then return end
- local bullet = {}
- bullet.Num = self.Primary.NumberofShots
- bullet.Src = self.Owner:GetShootPos()
- bullet.Dir = self.Owner:GetAimVector()
- bullet.Spread = Vector( self.Primary.Spread * 0.1 , self.Primary.Spread * 0.1, 0)
- bullet.Tracer = 0
- bullet.Force = self.Primary.Force
- bullet.Damage = self.Primary.Damage
- bullet.AmmoType = self.Primary.Ammo
- local rnda = self.Primary.Recoil * -1
- local rndb = self.Primary.Recoil * math.random(-1, 1)
- self:ShootEffects()
- self.Owner:FireBullets( bullet )
- self:EmitSound(Sound(self.Primary.Sound))
- self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) )
- self:TakePrimaryAmmo(self.Primary.TakeAmmo)
- self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
- self:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
- end
- function SWEP:SecondaryAttack()
- end
- function SWEP:Reload()
- self:EmitSound(Sound(self.ReloadSound))
- self.Weapon:DefaultReload( ACT_VM_RELOAD );
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement