Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. ITEM.Name = "HK45C"
  2. ITEM.Price = 10000
  3. ITEM.Model = "models/weapons/w_hk45c.mdl"
  4. ITEM.SingleUse = false
  5.  
  6.  
  7. function ITEM:OnEquip(ply)
  8.  
  9. --hook.Add("TTTBeginRound", "loadoutsec", function()
  10. for _, k in pairs(ply:GetWeapons()) do
  11. local wepclass = k:GetClass()
  12. local weptable = weapons.Get(wepclass)
  13. if weptable.Kind == WEAPON_PISTOL then --WEAPON_HEAVY if primary weapon, WEAPON_PISTOL if secondary.
  14. ply:StripWeapon(wepclass)
  15. end
  16. end
  17.  
  18. if IsValid(ply) and ply:Alive() then
  19. ply:Give(self.WeaponClass)
  20.  
  21. timer.Simple(1, function()
  22. ply:GiveAmmo( weapons.Get(self.WeaponClass).Primary.ClipMax, weapons.Get(self.WeaponClass).Primary.Ammo, false )
  23.  
  24. end )
  25. end
  26.  
  27. --end)
  28. end
  29.  
  30.  
  31. function ITEM:OnSell(ply)
  32. --hook.Remove("loadoutsec")
  33. end
  34.  
  35. function ITEM:OnHolster(ply)
  36. --hook.Remove("loadoutsec")
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement