Hello guys! I tried to make a NPC to a new quest, but sadly I'm not very good in creation of NPCs and it's with error(s) that I can't fix. If someone can do it for me, I would thank and give [red]Rep+[/red] 
NPC Script:
And the error:
I tried to edit this part, but it was pointless... <_<
NPC Script:
PHP:
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
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
function onCreatureSay(cid, type, msg)
if msgcontains(msg, 'warrior') then
if getPlayerVocation(cid) >= 9 then
selfSay('Yes, you are a warrior...')
else
selfSay('What?! Do you want to become a {Warrior}?', cid)
end
talkState[talkUser] = 2
if msgcontains(msg, 'yes') then
selfSay('Well, if you can prove me by some {tasks} that you are worth, I can think about it...', cid)
talkState[talkUser] = 1
elseif msgcontains(msg, 'task') or msgcontains(msg,'tasks') or msgcontaisn(msg,'quest') then
selfSay('Right, Here goes your first mission: My lance was stolen from here. I do not know how, but it happened. Probably it are with the {Cyclops}. Go there and try to find it. Ohh, remember that you can NOT use my lance!', cid)
talkState[talkUser] = 0
elseif talkState[talkUser] == 1 then
if msgcontains(msg, 'lance') then
if getPlayerItemCount(cid, 2414) >= 1 then
doPlayerRemoveItem(cid,2414,1)
selfSay('Good Job! Ask me for other missions when you want.', cid)
elseif getPlayerItemCount(cid, 2414) == 0 then
selfSay('Come back when you get the Gungnir.',cid)
talkState[talkUser] = 0
end
end
elseif talkstate[talkUser] == 1 then
if msgcontains(msg, 'task') or msgcontains(msg,'mission') then
selfSay('Yes, I have another mission for you, but first you need to do a favour to {Rob}. When you finish, talk to me again.', cid)
talkState[talkUser] = 0
end
elseif talkstate[talkUser] == 1 then
if msgcontains(msg, 'task') or msgcontains(msg, 'mission') then
if getPlayerStorageValue (cid,6690) <= 0 then
selfSay('You did not finished the mission of Rob. Come back when you have done.', cid)
else
selfSay('Uhm... Looks like you really can be a {Einherjar}. I will give you one last challenge: Defeat the great sacred dragon and you will be able to fight at us side. To know his location, step in the {wooden floor},in right of my throne.',cid)
talkState[talkUser] = 0
end
elseif talkState[talkUser] == 1 then
if msgcontains(msg, 'task') or msgcontains(msg,'mission') then
if getPlayerStorageValue(cid,6670) == 0 then
selfSay('You did not finish your mission yet',cid)
else
selfSay('Now you can pass trough the door and get your reward.',cid)
setPlayerStorageValue (cid,6671) = 1
end
end
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
And the error:
[11/02/2011 21:26:40] [Error - LuaScriptInterface::loadFile] data/npc/scripts/Odin.lua:62: unexpected symbol near '='
[11/02/2011 21:26:40] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/Odin.lua
[11/02/2011 21:26:40] data/npc/scripts/Odin.lua:62: unexpected symbol near '='
I tried to edit this part, but it was pointless... <_<