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

Promote Npc Problem

Kioshi

Only live in the present!
Joined
Oct 24, 2008
Messages
231
Reaction score
5
Location
Sweden
Hey i got a problem with my promote npc,in the .exe window it says [19/04/2009 22:04:38] Lua Script Error: [Npc interface]
[19/04/2009 22:04:38] data/npc/scripts/promote.lua:onCreatureSay

[19/04/2009 22:04:38] data/npc/lib/npcsystem/modules.lua:80: attempt to compare nil with number
[19/04/2009 22:04:38] stack traceback:
[19/04/2009 22:04:38] data/npc/lib/npcsystem/modules.lua:80: in function 'callback'
[19/04/2009 22:04:38] data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'
[19/04/2009 22:04:38] data/npc/lib/npcsystem/keywordhandler.lua:168: in function 'processNodeMessage'
[19/04/2009 22:04:38] data/npc/lib/npcsystem/keywordhandler.lua:122: in function 'processMessage'
[19/04/2009 22:04:38] data/npc/lib/npcsystem/npchandler.lua:371: in function 'onCreatureSay'
[19/04/2009 22:04:38] data/npc/scripts/promote.lua:7: in function <data/npc/scripts/promote.lua:7>
 
Here is a new one

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="The Forgotten King" script="data/npc/scripts/promotion.lua" autowalk="0" floorchange="0">
	<health now="100" max="100"/>
	<look type="130" head="21" body="87" legs="107" feet="115" addons="0"/>
</npc>

PHP:
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({'promot'}, 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, premium = false, 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())


Cheers~
Leiken.
 
Back
Top