kaspertje100
Member
- Joined
- May 8, 2008
- Messages
- 236
- Reaction score
- 7
my script:
error msg:
so this npc should be able to teleport players of level <= 30 and ask 50 GP for that.
My problem is that the NPC doesn't even talk at all.
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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
if(msgcontains(msg, 'north gate')) then
selfSay('Do you want to travel to the north gate for 50 gold coins?', cid)
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if getPlayerlevel(cid) <= 30 then
if(doPlayerRemoveMoney(cid, 50)) then
doTeleportThing(cid, {x= 828, y=1137, z=7})
selfSay('There you go!', cid)
else
selfSay('Sorry, you don\'t have enough gold.', cid)
end
elseif getPlayerlevel(cid) <= 30 then
if(doPlayerRemoveMoney(cid, 50)) then
doTeleportThing(cid, {x= 828, y=1137, z=7})
selfSay('There you go!', cid)
else
selfSay('Sorry, you don\'t have enough gold.', cid)
end
else
selfSay('Sorry, you are too high level', cid)
end
elseif(msgcontains(msg, 'no') and isInArray({1})) then
selfSay('Ok then.', cid)
end
error msg:
Code:
[19/05/2013 19:00:32] [Error - Npc interface]
[19/05/2013 19:00:32] data/npc/scripts/huifkar.lua
[19/05/2013 19:00:32] Description:
[19/05/2013 19:00:32] data/npc/lib/npc.lua:54: attempt to index local 'message' (a nil value)
[19/05/2013 19:00:32] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/huifkar.lua
so this npc should be able to teleport players of level <= 30 and ask 50 GP for that.
My problem is that the NPC doesn't even talk at all.