• Issues with pointshop single use items.
    1 replies, posted
I have been trying to add a grapplegun and lightsaber to my pointshop. I've only been able to get the grapplegun to be single use, if i try to make it a permanent buyable weapon it will not work. The opposite is true with the lightsaber, it will only be permanent, no single use. Thank you for any help! Here are my scripts [QUOTE]ITEM.Name = 'DonorPERM:SpidermanGun' ITEM.Price = 14999 ITEM.Model = 'models/weapons/w_pistol.mdl' ITEM.WeaponClass = 'weapon_ttt_grapplegun' ITEM.AllowedUserGroups = { "donor", "admin", "superadmin", "owner"} function ITEM:OnBuy(ply) ply:Give(self.WeaponClass) ply:SelectWeapon(self.WeaponClass) end function ITEM:OnSell(ply) ply:StripWeapon(self.WeaponClass) end [/QUOTE] [QUOTE]ITEM.Name = 'Saber' ITEM.Price = 5000 ITEM.Model = 'models/weapons/v_crewbar.mdl' ITEM.WeaponClass = 'weapon_ttt_light' ITEM.SingleUse = true function ITEM:OnEquip(ply) ply:StripWeapon('weapon_zm_improvised') -- Remove this if you're not replacing the melee weap ply:Give(self.WeaponClass) ply:SelectWeapon(self.WeaponClass) end function ITEM:OnHolster(ply) ply:StripWeapon(self.WeaponClass) ply:Give('weapon_zm_improvised') -- Remove this if you're not replacing the melee weap ply:SelectWeapon('weapon_zm_improvised') -- Remove this if you're not replacing the melee weap end [/QUOTE]
After some fiddling I have figured it out. For permanent weapons it must be function ITEM:onEQUIP instead of ITEM:onBUY for it to work.
Sorry, you need to Log In to post a reply to this thread.