Hey there,
Recently I updated my TFS version from 1.0 to 1.2 and I'm having some troubles updating my Task System, can anyone help?
CONSOLE ERROR:
NPC/SCRIPTS/TASK.LUA:
Recently I updated my TFS version from 1.0 to 1.2 and I'm having some troubles updating my Task System, can anyone help?
CONSOLE ERROR:
NPC/SCRIPTS/TASK.LUA:
Code:
local choose = {}
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_PRIVATE and 0 or cid
if isInArray({"task", "tasks"}, msg:lower()) then
selfSay("Here.", cid)
taskNPCuid = getNpcCid()
if player:getStorageValue(cid, 32150) < 0 then player:setStorageValue(cid, 32150, 0) end
return taskWindow:sendToPlayer(cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())