Advertisement
BuilderGaming

KRISS Vector

Jul 5th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.19 KB | None | 0 0
  1. if SERVER then
  2.    AddCSLuaFile()
  3. end
  4.  
  5. SWEP.HoldType        = "ar2"
  6.  
  7.  
  8. if CLIENT then
  9.  
  10.    SWEP.PrintName       = "KRISS Vector"
  11.    SWEP.Slot            = 2
  12. end
  13.  
  14.  
  15. SWEP.Base            = "weapon_tttbase"
  16.  
  17. SWEP.Kind = WEAPON_HEAVY
  18.  
  19. SWEP.Primary.Delay         = 0.07
  20. SWEP.Primary.Recoil        = 0.2
  21. SWEP.Primary.Automatic     = true
  22. SWEP.Primary.Ammo          = "Pistol"
  23. SWEP.Primary.Damage        = 12
  24. SWEP.Primary.Cone          = 0.035
  25. SWEP.Primary.ClipSize      = 30
  26. SWEP.Primary.ClipMax         = 60
  27. SWEP.Primary.DefaultClip   = 30
  28. SWEP.AutoSpawnable         = true
  29. SWEP.AmmoEnt               = "item_ammo_pistol_ttt"
  30.  
  31. SWEP.UseHands        = true
  32. SWEP.ViewModelFlip      = true
  33. SWEP.ViewModelFOV    = 70
  34. SWEP.ViewModel       = "models/weapons/kriss/v_kriss_svs.mdl"
  35. SWEP.WorldModel         = "models/weapons/kriss/w_kriss_vector.mdl"
  36.  
  37. SWEP.Primary.Sound = Sound( "kriss_vector.Single" )
  38.  
  39. SWEP.IronSightsPos = Vector(3.943, -0.129, 1.677)
  40. SWEP.IronSightsAng = Vector(-1.922, 0.481, 0)
  41.  
  42.  
  43. function SWEP:SetZoom(state)
  44.    if CLIENT then return end
  45.    if not (IsValid(self.Owner) and self.Owner:IsPlayer()) then return end
  46.    if state then
  47.       self.Owner:SetFOV(50, 0.3)
  48.    else
  49.       self.Owner:SetFOV(0, 0.2)
  50.    end
  51. end
  52.  
  53. -- Add some zoom to ironsights for this gun
  54. function SWEP:SecondaryAttack()
  55.    if not self.IronSightsPos then return end
  56.    if self.Weapon:GetNextSecondaryFire() > CurTime() then return end
  57.  
  58.    bIronsights = not self:GetIronsights()
  59.  
  60.    self:SetIronsights( bIronsights )
  61.  
  62.    if SERVER then
  63.       self:SetZoom(bIronsights)
  64.    end
  65.  
  66.    self.Weapon:SetNextSecondaryFire(CurTime() + 0.3)
  67. end
  68.  
  69. function SWEP:PreDrop()
  70.    self:SetZoom(false)
  71.    self:SetIronsights(false)
  72.    return self.BaseClass.PreDrop(self)
  73. end
  74.  
  75. function SWEP:Reload()
  76.    self.Weapon:DefaultReload( ACT_VM_RELOAD );
  77.    self:SetIronsights( false )
  78.    self:SetZoom(false)
  79. end
  80.  
  81.  
  82. function SWEP:Holster()
  83.    self:SetIronsights(false)
  84.    self:SetZoom(false)
  85.    return true
  86. end
  87.  
  88. if CLIENT then
  89.    function SWEP:DrawHUD()
  90.       if not self:GetIronsights() or GetConVar("ttt_ironsights_lowered"):GetBool() then
  91.         return self.BaseClass.DrawHUD(self)
  92.       end
  93.    end
  94. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement