Tibiamakers
yourolist.com
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
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if(msgcontains(msg, 'cave')) and (getPlayerStorageValue(cid,13500,1)) then
SelfSay('Please Find {Kalima}, I need to know if it\'s alive!... tell her that I love her...',cid)
else
selfSay('Oh, Never told about it to nobody...do you want to know about that {cave}..?', cid)
talkState[talkUser] = 1
end
if(msgcontains(msg, 'no')) and talkState[talkUser] == 1 then
selfSay('I think, she will be... fine.', cid)
elseif (msgcontains(msg, 'yes')) or (msgcontains(msg, 'cave')) and talkState[talkUser] == 1 then
SelfSay(' Well i\'m a bit nervious... In that cave are the most horror can you think, nasty and horrible creatures live there, everybody who enter don\'t come again... But you.. You are the last hope to.. Well if you see {Kalima} tell her that I love her...',cid)
setPlayerStorageValue(cid,13500,1)
end
if(msgcontains(msg, 'Kalima')) and talkState[talkUser] == 1 then
SelfSay(' Kalima...she entered the cave...',cid)
else
SelfSay('How do you know that Name?! You know something about she?!',cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

I'm learning LUA, and I can't see the error here, someone can correct it or tell me what I have done wrong?
thanks
