Thank you for the reply. I tried adding this code to the equipt function but it just removed the weapon from both teams and I get this error in the console but I can't figure out what I did wrong. I stole the if statement from the init.lua file.
ITEM.Name = 'Permanant Gamma Shooter'
ITEM.Price = 40000
ITEM.Model = 'models/weapons/w_smg1.mdl'
ITEM.WeaponClass = 'weapon_gammashooter'
ITEM.SingleUse = false
function ITEM:OnBuy(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end
function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end
function ITEM:OnEquip(ply)
if pl:Team() == TEAM_HUNTERS then
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end
end
function ITEM:OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
end
local function PlayerLoadout( ply )
ply:Give(self.WeaponClass)
end
And I get this console error
[ERROR] addons/pointshop-master/lua/pointshop/items/weapons/gammashooter.lua:18:attempt to index global 'ITEM' (a nil value)
and
[ERROR] addons/pointshop-master/lua/pointshop/items/weapons/gammashooter.lua:18:attempt to index global 'pl' (a nil value)