Ok so I am trying to code this Gail into the TTT point shop So far I have the icon and the gun in the shop but when I buy it, it never spawns or equips. Here is my code I need some help!
ITEM.Name = 'Gail'
ITEM.Price = 500
ITEM.WeaponClass = 'weapon_ar2'
ITEM.Model = 'models/weapons/v_rif_galil.mdl'
ITEM.Material = 'materials/weapons/weapon_mad_galil.vmt'
ITEM.SingalUse = true
function ITEM:OnBuy(ply)
ply:Give(self.Weapon)
end
// Equiping when you go to buy the gun it Equips.
function ITEM:OnEquip(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end
function ITEM.OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
end
Help!
-
- A semi-regular
- Posts: 16
- https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
- Joined: Fri Jun 14, 2013 4:19 pm
Re: Help!
Make sure ITEM.WeaponClass is the folder that contains the SWEP (shared.lua)
Here is my pointshop galil
Here is my pointshop galil
ITEM.Name = 'Galil'
ITEM.Price = 55
ITEM.Model = 'models/weapons/w_rif_galil.mdl'
ITEM.WeaponClass = 'weapon_ttt_galil'
ITEM.SingleUse = true
function ITEM:OnBuy(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end
function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end