Advertisement
TerryPeppers

Untitled

Aug 7th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. function SWEP:SecondaryAttack()
  2. if( not self:CanPrimaryAttack() ) then
  3.  
  4. return true;
  5.  
  6. end
  7.  
  8. vm = self.Owner:GetViewModel()
  9. self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
  10. self.Owner:ViewPunch(Angle(-2,0,0))
  11. if self:CanPrimaryAttack() and self.Owner:IsPlayer() then
  12. self.Weapon:EmitSound("pillar_energy_sword/fp_energy_sword_melee"..math.random(1,3)..".wav")
  13. if SERVER then
  14. if !self.Owner:KeyDown(IN_SPEED) and !self.Owner:KeyDown(IN_RELOAD) then
  15. timer.Create("hack-n-slash2", .23, 1, function() if not IsValid(self) then return end
  16. if IsValid(self.Owner) and
  17. IsValid(self.Weapon) then
  18. if self.Owner:Alive() and self.Owner:GetActiveWeapon():GetClass() == self.Gun then
  19. self:HackNSlash2() end end end)
  20. self.Owner:SetAnimation( PLAYER_ATTACK1 )
  21. self.Weapon:SetNextPrimaryFire(CurTime()+1/(self.Primary.RPM/60))
  22. end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement