http://www13.speedy*****malware.localhost/files/25795946/download/npc.jpg
I think you can see what the problem is.. help plx?
Code:
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, 'reward') then
selfSay("Ah! I see you are here to take your reward {yes} ?",cid)
talkState[talkUser] =1
elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
selfSay("Here is your reward.",cid)
doPlayerAddItem(cid,6527,20)
doSendMagicEffect(getThingPos(cid),49)
addEvent(doTeleportThing, 50,cid,{x=1000,y=1000,z=7})
talkState[talkUser] = 0
elseif msgcontains(msg, 'no') and talkState[talkUser] == 1 then
selfSay("Maybe later.",cid)
talkState[talkUser] = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
I think you can see what the problem is.. help plx?