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

npc error

mesosot

Member
Joined
Aug 16, 2007
Messages
356
Reaction score
5
i get this error help

Hi
promotion
yes - he no response

Code:
[22/07/2010 16:39:47] [Error - Npc interface] 
[22/07/2010 16:39:47] data/npc/scripts/promotion.lua:onCreatureSay
[22/07/2010 16:39:47] Description: 
[22/07/2010 16:39:47] data/npc/lib/npcsystem/modules.lua:80: attempt to compare nil with number
[22/07/2010 16:39:47] stack traceback:
[22/07/2010 16:39:48] 	data/npc/lib/npcsystem/modules.lua:80: in function 'callback'
[22/07/2010 16:39:48] 	data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'
[22/07/2010 16:39:48] 	data/npc/lib/npcsystem/keywordhandler.lua:168: in function 'processNodeMessage'
[22/07/2010 16:39:48] 	data/npc/lib/npcsystem/keywordhandler.lua:122: in function 'processMessage'
[22/07/2010 16:39:48] 	data/npc/lib/npcsystem/npchandler.lua:380: in function 'onCreatureSay'
[22/07/2010 16:39:48] 	data/npc/scripts/promotion.lua:7: in function <data/npc/scripts/promotion.lua:7>
 
try this

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 node1 = keywordHandler:addKeyword({'promotion'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'})
	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, promotion = 1, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})

npcHandler:addModule(FocusModule:new())

GO TO YOUR server folder NPC/Scripts find Promotion and replace with this.
 
Back
Top