Guest User

Untitled

a guest
Jun 13th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.52 KB | None | 0 0
  1. AddCSLuaFile("hands.lua")
  2.  
  3. SWEP.ViewModel              = "models/Weapons/V_hands.mdl"
  4. SWEP.WorldModel             = "models/weapons/w_pist_usp.mdl"
  5.  
  6. SWEP.HoldType               = "fist"
  7.  
  8. SWEP.Primary.ClipSize       = -1
  9. SWEP.Primary.DefaultClip    = -1
  10. SWEP.Primary.Automatic      = true
  11. SWEP.Primary.Ammo           = "none"
  12.  
  13. SWEP.Secondary.Clipsize     = -1
  14. SWEP.Secondary.DefaultClip  = -1
  15. SWEP.Secondary.Automatic    = false
  16. SWEP.Secondary.Ammo         = "none"
  17.  
  18. SWEP.DrawAmmo               = false
  19. SWEP.DrawCrosshair          = false
  20.  
  21. function SWEP:Initialize()
  22.     self:SetWeaponHoldType("fist")
  23.     self.Owner.CD1 = CurTime()
  24. end
  25.  
  26. function SWEP:ShouldDropOnDie()
  27.     return false
  28. end
  29.  
  30. function SWEP:Think()
  31. end
  32.  
  33. function SWEP:Reload()
  34. end
  35.  
  36. local Box = Vector(16,16,16)
  37.  
  38. function SWEP:PrimaryAttack()
  39.     if (CLIENT and !IsFirstTimePredicted()) then return end
  40.     if (self.Owner.CD1 and self.Owner.CD1 > CurTime()) then return end
  41.    
  42.     self.Owner:SetAnimation( PLAYER_ATTACK1 )
  43.    
  44.     if (SERVER) then
  45.         local Trace = {
  46.             start   = self.Owner:GetShootPos(),
  47.             endpos  = self.Owner:GetShootPos()+self.Owner:GetAimVector()*30,
  48.             filter  = self.Owner,
  49.             mins    = Box*-1,
  50.             maxs    = Box,
  51.         }
  52.        
  53.         local Tr = util.TraceHull(Trace)
  54.        
  55.         if (ValidEntity(Tr.Entity)) then
  56.             Tr.Entity:SetVelocity(self.Owner:GetAimVector()*200)
  57.             Tr.Entity:EmitSound("player/taunt_chest_thump.wav",100,math.random(90,110))
  58.         else
  59.             self.Owner:EmitSound("weapons/iceaxe/iceaxe_swing1.wav")
  60.         end
  61.     end
  62.    
  63.     self.Owner.CD1 = CurTime()+0.2
  64. end
  65.  
  66. function SWEP:SecondaryAttack()
  67. end
Add Comment
Please, Sign In to add comment