Not very descriptive but meh,
[LUA]
function SWEP:WasBought(buyer)
if IsValid(buyer) then -- probably already self.Owner
buyer:GiveAmmo( 20, "Pistol" )
end
end
[/LUA]
As long as you have SWEP.LimitedStock = false then this should work. Reply if it doesn't.
Sorry about the no information, it was about 4 in the morning and I just wasn't thinking.
So - I just want the players to be able to buy ammo from the pointshop.
The code you gave me crashes the server because of:
[CODE][ERROR] lua/items/powerups/pistolammo.lua:1: attempt to index global 'SWEP' (a nil value)
1. unknown - lua/items/powerups/pistolammo.lua:1
2. include - [C]:-1
3. LoadItems - lua/sh_pointshop.lua:105
4. unknown - lua/autorun/pointshop.lua:35[/CODE]
Sorry, you need to Log In to post a reply to this thread.