CapsAdmin

Untitled

Aug 1st, 2011
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. local SWEP = {Primary = {}, Secondary = {}}
  2.  
  3. SWEP.Base = "weapon_cs_base"
  4. SWEP.ClassName = "my"
  5.  
  6. function SWEP:Initialize()
  7.  
  8. end
  9.  
  10. function SWEP:PrimaryAttack()
  11.     if SERVER then return end
  12.  
  13.     local data = self.Owner:GetEyeTrace()
  14.    
  15.     if data.Entity:IsValid() then
  16.         RunConsoleCommand("say", Format("look at this %s", data.Entity:GetName()))
  17.     end
  18. end
  19.  
  20.  
  21. -- this will reload the swep in REal TIme While HolDINg iT
  22. for _, wep in pairs(ents.FindByClass(SWEP.ClassName)) do
  23.     wep:SetTable(table.Merge(wep:GetTable(), SWEP))
  24. end
  25.  
  26. weapons.Register(SWEP, SWEP.ClassName, true)
Advertisement
Add Comment
Please, Sign In to add comment