• 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 How can i prevent this error

henkas

Well-Known Member
Joined
Jul 8, 2015
Messages
1,051
Solutions
5
Reaction score
62
Not sure how this happens but i assume its because maybe there is item that doesnt exist in the traders? But tracking it is just wild
Lua Script Error: [Npc interface]
(Unknown scriptfile)
data/npc/lib/npcsystem/modules.lua:1017: [ShopModule.onSell] items[itemid] == nil
stack traceback:
[C]: at 0x5555556bbdc0
[C]: in function 'error'
data/npc/lib/npcsystem/modules.lua:1017: in function 'callbackOnSell'
data/npc/lib/npcsystem/npchandler.lua:272: in function 'processModuleCallback'
data/npc/lib/npcsystem/npchandler.lua:476: in function 'onSell'
data/npc/lib/npcsystem/modules.lua:1080: in function <data/npc/lib/npcsystem/modules.lua:1080>
 
Data/npc/lib/npcsystem/modules.lua
Go to line 1017

Do an if statement to check before that line:
LUA:
if not items[itemid] then
    print(“Player “..Player(cid):getName().. “ tried to sell an invalid item”)
return false
end
 
Last edited:
Back
Top