• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

lua in npc error

tim26

Member
Joined
Aug 12, 2008
Messages
618
Reaction score
11
Location
Poland
Hello when i buy parcel i got that error in console, he normal give parcel but how delete this error?

Code:
[14/09/2008  10:34:53] Lua Script Error: [Npc interface] 
[14/09/2008  10:34:53] data/npc/scripts/parcel.lua:onCreatureSay

[14/09/2008  10:34:53] data/global.lua:396: attempt to compare number with nil
[14/09/2008  10:34:53] stack traceback:
[14/09/2008  10:34:53] 	data/global.lua:396: in function <data/global.lua:391>
[14/09/2008  10:34:53] 	(tail call): ?
[14/09/2008  10:34:53] 	data/npc/lib/npcsystem/modules.lua:758: in function 'callback'
[14/09/2008  10:34:53] 	data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'
[14/09/2008  10:34:53] 	data/npc/lib/npcsystem/keywordhandler.lua:173: in function 'processNodeMessage'
[14/09/2008  10:34:53] 	data/npc/lib/npcsystem/keywordhandler.lua:126: in function 'processMessage'
[14/09/2008  10:34:53] 	data/npc/lib/npcsystem/npchandler.lua:265: in function 'onCreatureSay'
[14/09/2008  10:34:53] 	data/npc/scripts/parcel.lua:10: in function <data/npc/scripts/parcel.lua:10>


its my npc

Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)



-- OTServ event handling functions start
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
-- OTServ event handling functions end

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

shopModule:addBuyableItem({'parcel', 'Parcel'}, 		2595, 15, 		'Parcel with an sigh')
shopModule:addBuyableItem({'label', 'Label'}, 		2599, 1, 		'Label with an sigh')
shopModule:addBuyableItem({'letter', 'Letter'}, 		2597, 8, 		'Letter with an sigh')
                            
npcHandler:addModule(FocusModule:new())
 
Back
Top