Hi.
I am going to make a djinn npc but it doesnt work...
heres the script:
and here's the error:
please help me:thumbup:
Sincerly,
Furstwin.
I am going to make a djinn npc but it doesnt work...
heres the script:
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
function creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if(npcHandler.focus ~= cid) then
return false
end
if msgcontains(msg, 'mission') or msgcontains(msg, 'quest') or msgcontains(msg, 'passage') then
selfSay('Do you want to face the djinns?')
talk_state = 1
elseif msgcontains(msg, 'yes') and talk_state == 1 then
setPlayerStorageValue(cid,968277,1)
selfSay('You have joined the djinns.')
end
end
------------------------------------------------
if msgcontains(msg, 'piano') then
queststatus = getPlayerStorageValue(cid,968278)
if queststatus == 1 then
selfSay('Did you play the piano?')
talk_state = 2
else
selfSay('You have to play the piano first.')
talk_state = 0
end
end
if msgcontains(msg, 'yes') and talk_state == 2 then
talk_state = 0
selfSay('Congratulations! You have done the test!')
setPlayerStorageValue(cid,968279,1)
end
if msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
selfSay('Shaki.')
talk_state = 0
end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
and here's the error:
Code:
Warning: [NpcScript::NpcScript] Can not load script. data/npc/scripts/templepriest.lua
data/npc/scripts/templepriest.lua:55: '<eof>' expected near 'end'
please help me:thumbup:
Sincerly,
Furstwin.