CapsAdmin

Untitled

Mar 7th, 2012
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. local SWEP = {}
  2. SWEP.Base = "test_weapon2"
  3.  
  4. SWEP.HoldType = "pistol"
  5. SWEP.WorldModel = "models/weapons/w_pist_glock18.mdl"
  6. SWEP.ViewModel = "models/weapons/v_pist_glock18.mdl"
  7.  
  8. SWEP.Primary =
  9. {
  10.     Ammo = "pistol",
  11.     Automatic = false,
  12.     ClipSize = 10,
  13.     DefaultClip = 1,
  14.  
  15.     Damage = 10,
  16.  
  17.     Bullet =
  18.     {
  19.         Sound =
  20.         {
  21.             Path = "Weapon_AWP.Single",
  22.             Pitch = {50, 80},
  23.         },
  24.     }
  25. }
  26.  
  27. SWEP.Secondary =
  28. {
  29.     Ammo = "pistol",
  30.     Automatic = false,
  31.     ClipSize = 10,
  32.     DefaultClip = 1,
  33.  
  34.     Damage = 1,
  35.  
  36.     Bullet =
  37.     {
  38.         Sound =
  39.         {
  40.             Path = "chatsounds/autoadd/youtube_expedition_1/Horse Neigh.mp3",
  41.             Pitch = {50, 150},
  42.         },
  43.     }
  44. }
  45.  
  46. function SWEP:OnInputEvent(key, press)
  47.     if press and key == IN_ATTACK then
  48.         self.Owner:SetAnimation(PLAYER_ATTACK1)
  49.         self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
  50.         self:ShootBullets(self.Primary.Bullet)
  51.     end
  52. end
  53.  
  54. function SWEP:Think()
  55.     if self:IsKeyDown(IN_ATTACK2) then
  56.         self.Owner:SetAnimation(PLAYER_ATTACK1)
  57.         self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
  58.         self:ShootBullets(self.Secondary.Bullet)
  59.     end
  60. end
Advertisement
Add Comment
Please, Sign In to add comment