Lucas Durais
New Member
- Joined
- Jan 13, 2017
- Messages
- 40
- Reaction score
- 1
Hello guys
I'm trying to make my npc only sell some items if the player have one storage.
I've tried a lot of different ways and none of them worked for me...
In my last attempt I did as it follows:
The problem is that if I have more then 1 item in my container, it will sell all of them, and if I buy 1x item, I will actually buy 2x items..
I have no idea of what the problem is and how I can get this npc working with storages...
Thanks!!
I'm trying to make my npc only sell some items if the player have one storage.
I've tried a lot of different ways and none of them worked for me...
In my last attempt I did as it follows:
Code:
local function greetCallback(cid)
if getPlayerStorageValue(cid, Storage.Quest.Rank) >= 1 then
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addSellableItem({'item name'}, 2460, 120, 'item name that appears')
shopModule:addBuyableItem({'item name'}, 2460, 120, 'item name that appears')
end
return true
end
The problem is that if I have more then 1 item in my container, it will sell all of them, and if I buy 1x item, I will actually buy 2x items..
I have no idea of what the problem is and how I can get this npc working with storages...
Thanks!!