Cant buy Items from trader (Problem)

Stanos

Banned User
Joined
Jun 12, 2018
Messages
399
Reaction score
136
USING TFS 1.2
So people helped me in this forum how to make traders but when i tried to test them i noticed that i can sell my items but when i want to buy them i cant it always shows grey. Code
BTW yes i had gold in my bag.
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)              npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)           npcHandler:onCreatureDisappear(cid)         end
function onCreatureSay(cid, type, msg)      npcHandler:onCreatureSay(cid, type, msg)    end
function onThink()                          npcHandler:onThink()                        end

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'cheese'}, 2461, 200, 'cheese')
shopModule:addBuyableItem({'meat'}, 2482, 300, 'meat')

function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    end
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 

Itutorial

Advanced OT User
Joined
Dec 23, 2014
Messages
1,441
Reaction score
317
Change

shopModule:addBuyableItem({'cheese'}, 2461, 200, 'cheese')

to

shopModule:addBuyableItem({'cheese'}, 2461, 200, 1, 'cheese')
 

Itutorial

Advanced OT User
Joined
Dec 23, 2014
Messages
1,441
Reaction score
317
edit nvm make this when I was tired.

I believe there is a spot in the shopmodule that needs to be changed. I forget where its at. I will look today after work if no one helps you.
 

StreamSide

Joseluis Gonzalez
Support Team
Joined
Aug 31, 2007
Messages
3,272
Reaction score
779
Location
Arica - Chile
shop modules works fine. I guess you are using some corrupted datapack or non tfs datapack.
also if you want to sell products then use the sellmodule
 
OP
Stanos

Stanos

Banned User
Joined
Jun 12, 2018
Messages
399
Reaction score
136
shop modules works fine. I guess you are using some corrupted datapack or non tfs datapack.
also if you want to sell products then use the sellmodule
It might be possible, because i'm using
ninjalulz/forgottenserver
As i remember couple month ago i changed npchandler into the new one because i had problem with range and "trade" not sure tho. With sell products i dont have problems it works fine.
 

StreamSide

Joseluis Gonzalez
Support Team
Joined
Aug 31, 2007
Messages
3,272
Reaction score
779
Location
Arica - Chile
havent tested that yet so cant say if its working or no, there is no npc buying stuff?
 
OP
Stanos

Stanos

Banned User
Joined
Jun 12, 2018
Messages
399
Reaction score
136
havent tested that yet so cant say if its working or no, there is no npc buying stuff?
It shows that there is stuff that i can buy, but you cant buy them it always locked you can have as much money as you want but still it wont let you buy it.
 
OP
Stanos

Stanos

Banned User
Joined
Jun 12, 2018
Messages
399
Reaction score
136
Would be great to get support related with this problem tho ;D bump
 
Top