I am having problems with my Garry’s mod pointshop. I have a TDM server and I want to add permanent weapons, but whenever you respawn, you lose the weapons and have to sell them and then buy them back. Here is the code for one of the weapons. Does anybody have any suggestions?
ITEM.Name = 'Crossbow' ITEM.Price = 20000 ITEM.Model = 'models/weapons/w_crossbow.mdl' ITEM.WeaponClass = 'weapon_crossbow' ITEM.SingleUse = false function ITEM:OnBuy(player) player:Give(self.WeaponClass) player:SelectWeapon(self.WeaponClass) end function ITEM:OnSell(player) player:StripWeapon(self.WeaponClass) end function GAMEMODE:PlayerSpawn(player) player:Give(self.WeaponClass) end
Edit: I also tried
function ITEM:PlayerSpawn(ply) player:Give(self.WeaponClass) end