Garry's Mod

Garry's Mod

PointShop
Slater 25 Dec, 2019 @ 12:44am
Only working when it wants to
I put a bunch of M9K guns in my pointshop items using this basic lua script:

ITEM.Name = 'NAME'
ITEM.Price = PRICE
ITEM.Model = 'WORLD MODEL'
ITEM.WeaponClass = 'WEAPON CLASS'
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

And the guns only show up sometimes. PLEASE HELP
< >
Showing 1-3 of 3 comments
crester  [developer] 25 Dec, 2019 @ 1:26am 
well, can you describe this "guns only show up sometimes" a bit more properly in details? do weapons exist only by a certain chance or what
Slater 25 Dec, 2019 @ 1:29am 
Originally posted by crester:
well, can you describe this "guns only show up sometimes" a bit more properly in details? do weapons exist only by a certain chance or what
i think they take some time to show up. About a few minutes
Rat 12 Mar, 2020 @ 1:55am 
Strip the weapon in the slot it occupies before giving them the new weapon. It won't give it to them if there currently is one in the slot.
< >
Showing 1-3 of 3 comments
Per page: 1530 50