Hello, I was trying to make some derma based NPCs that sell Pointshop items.
The function used to give items in Pointshop is ply:PS_GiveItem(itemid) So, I tried doing something like this:
pShopButt.DoClick = function( Player )
Player:PS_GiveItem('kfcbucket')
Player:PS_EquipItem('kfcbucket')
end
However I got: attempt to call method ‘PS_GiveItem’ (a nil value)
I also tried adding if SERVER and if CLIENT then statements to the beginning but no avail.
Start a net message with the item name to the server, on the server read the item name and give it to the player who sent the net message (second argument in the net.Receive callback).
Since it’s on the server, you can also do some validation to check that the player meets the criteria to obtain the item, etc.