• 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!

TFS 1.2 Bug With Traders (shopModule:addBuyableItem)

henkas

Well-Known Member
Joined
Jul 8, 2015
Messages
993
Solutions
5
Reaction score
55
Hello
im having weird problem only with buyable items i cant buy them but i can sell them.
Lua:
shopModule:addBuyableItem({'Frog'}, 2461, 200, 1, 'Frog')
Sellable items works just fine.

TFS 1.2 8.60
 
Do you happen to have this line in the script? Also, it happens with every npc?

Code:
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
 
Do you happen to have this line in the script? Also, it happens with every npc?

Code:
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
Yea i do
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({'rat'}, 2461, 200, 1, 'rat')
shopModule:addBuyableItem({'frog'}, 2482, 300, 1, 'frog')

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())
 
no error on console mate? Try replacing your libs folder inside data/npc with an unmodified one
No errors no nothing but it shouldn't be any error because i cant press buy so it wont call this buy function. Mine is unmodified "pretty much" thinks i changed was with message delay fix thats it. So if i replace it i will lose my changes which is pretty important to me.
 
Lul it looks like with admin you cant buy :D thanks i would never though about this. Probably next time i need to test everything with normal character

The problem is because in ADM character "capacity = 0" you cannot buy, maybe you can make some changes to ignore if admin, if you want to buy with admin anyway you can right click and select "ignore capacity"
 
The problem is because in ADM character "capacity = 0" you cannot buy, maybe you can make some changes to ignore if admin, if you want to buy with admin anyway you can right click and select "ignore capacity"
Nah its okay now i know it works. With admin i can /i name, amount
 
Back
Top