Ziggy
Member
- Joined
- Aug 11, 2007
- Messages
- 49
- Reaction score
- 6
Here is my quest npc
for some reason he does not reply to the word backpack, what is wrong with him?
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, 'backpack') then
if getPlayerItemCount(cid, 3960) == 1 then
if getPlayerStorageValue(cid, 20002) == 2 then
doPlayerRemoveItem(cid, 3960, 1)
doPlayerAddItem(cid, 2687, 10)
doPlayerSetStorageValue(cid, 20002, 3)
talkState[talkUser] = 1
elseif getPlayerStorageValue(cid, storage) == 1 then
doPlayerSendCancel(cid, "You do not have my backpack!")
elseif getPlayerStorageValue(cid, storage) == 3 then
doPlayerSendCancel(cid, "You have already traded this item.")
end
else doPlayerSendCancel(cid, "You do not have my backpack!")
end
end
return true
end
npcHandler:addModule(FocusModule:new())
for some reason he does not reply to the word backpack, what is wrong with him?