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

Lua Problem with NPC trade

nowayrlz

New Member
Joined
Nov 10, 2011
Messages
19
Reaction score
1
I'm using OTServ 0.6.4 for 8.6, I got a global map w/ npcs but I'm unable to buy anything from them.

Any tips on how to solve this? I already tried replacing libs of different ots but always error.

Lua Script Error: [Npc interface]
(Unknown scriptfile)

data/npc/scripts/lib/npcsystem/npchandler.lua:265: bad argument #1 to 'unpack' (table expected, got nil)
stack traceback:
[C]: in function 'unpack'
data/npc/scripts/lib/npcsystem/npchandler.lua:265: in function 'processModuleCallback'
data/npc/scripts/lib/npcsystem/npchandler.lua:467: in function 'onBuy'
data/npc/scripts/lib/npcsystem/modules.lua:903: in function <data/npc/scripts/lib/npcsystem/modules.lua:903>

npcsystem.lua: http://pastebin.com/tEakrsiu
npchandler.lua: http://pastebin.com/k8p4jt8a
modules.lua: http://pastebin.com/cMkDqPum
keywordhandler.lua: http://pastebin.com/LerznDWu

in case you need the shop script: http://pastebin.com/v4bWx0ER
 
Last edited:
Nevermind, I just solved my problem,
In case anyone step at similar thing here it is:
Code:
elseif(id == CALLBACK_ONBUY and module.callbackOnBuy ~= nil) then
                tmpRet = module:callbackOnBuy(unpack(arg))
magic arg is deprecated in Lua 5.1 and you should replace by {...}
Working code:
Code:
elseif(id == CALLBACK_ONBUY and module.callbackOnBuy ~= nil) then
                tmpRet = module:callbackOnBuy(unpack({...}))
 
Back
Top