• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Cant buy Items from trader (Problem)

Stanos

Veteran OT User
Joined
Jun 12, 2018
Messages
584
Solutions
4
Reaction score
314
Location
Europe
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())
 
Change

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

to

shopModule:addBuyableItem({'cheese'}, 2461, 200, 1, 'cheese')
 
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.
 
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
 
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.
 
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.
 
can you post some pics please?
Ofc :)
Untitled.png

As you can see i cant buy them
 
Back
Top