Pointshop Perma weps not showing up

I’m trying to add a pointshop permanent weapons category to my pointshop but the tab is there but no permanent weapons appear. All of the code seems okay to me but I’m pretty amateur and I’m completely stumped. So, as I do, I resort to the coding gods that hibernate here on Facepunch as they know what they’re doing, unlike myself.


ITEM.Name = 'CS:S AK47'
ITEM.Price = 150000
ITEM.Model = 'models/weapons/W_rif_ak47.mdl'
ITEM.WeaponClass = 'weapon_ttt_ak47'
ITEM.SingleUse = false

function ITEM:OnBuy(ply)
	ply:Give(self.WeaponClass)
end

function ITEM:OnEquip(ply)
	ply:Give(self.WeaponClass)
end

function ITEM:OnHolster(ply)
	ply:StripWeapon(self.WeaponClass)
end

function ITEM:OnSell(ply)
	ply:StripWeapon(self.WeaponClass)
end


Try this


ITEM.Name = 'CS:S AK47'
ITEM.Price = 150000
ITEM.Model = 'models/weapons/W_rif_ak47.mdl'
ITEM.WeaponClass = 'weapon_ttt_ak47'
ITEM.SingleUse = false

function ITEM:OnEquip(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end

function ITEM:OnBuy(ply)
ply:Give(self.WeaponClass)
ply:SelectWeapon(self.WeaponClass)
end

function ITEM:OnHolster(ply)
ply:StripWeapon(self.WeaponClass)
end

function ITEM:OnSell(ply)
ply:StripWeapon(self.WeaponClass)
end

Ok, thank you, I’ll report back once I’ve checked this :slight_smile:

[editline]26th January 2014[/editline]

That doesnt seem to have made the permenant weapons appear in the pointshop. Maybe there’s an error in the __category.lua


CATEGORY.Name = 'Weapons (Permenant)'
CATEGORY.Icon = 'bomb'
CATEGORY.Order = 8
CATEGORY.AllowedEquipped = 1

Its probably because you used invalid characters in the name, just try AK47 for the name…

I know that’s rubbish since I have a single use weapon store where the only thing different in the pointshop files are the ITEM.Singleuse and the functions beneath it, and the __category.lua.

I’m probably getting banned for this:

ACECOOL NEEDED

Is your category.lua named with two _ ?

It’s permanent, btw, not permenant.

You can criticize my spelling, but your reading is hardly admirable. The tab appears, so of course there are two underscores.

if the files have the same name they dont show up have you tried that

The file name can’t have any capitals or spaces.
So it can’t be: AK47 Weapon.lua
It needs to be: ak47weapon.lua

Try that.

You also can’t have it the same name as something else, even in a different folder

Sorry, it’s just been in my nature to be a grammar nazi.

You sir, are getting a gold star for fixing this. They have the same name as the single purchase .lua files so I changed the name and it worked. Thanks :slight_smile: