hi guys, wanted someone to cuddle up this script npc, so that if the player has already spoken with him, he exhort the players already have the storage value can someone help me with this.
Hugs KoJiiRo
Hugs KoJiiRo
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() 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, 'inquisitor') then
selfSay('The churches of the gods entrusted me with the enormous and responsible task to lead the inquisition. I leave the field work to inquisitors who I recruit from fitting people that cross my way. If you wanna {join} in the inquisition, ask me why!' ,cid)
setPlayerStorageValue(cid,15209,1)
talkState[talkUser] = 1
elseif talkState[talkUser] == 1 then
if msgcontains(msg, 'join') then
selfSay('Do you want to join the inquisition?', cid)
talkState[talkUser] = 2
end
elseif msgcontains(msg, 'yes') then
if getPlayerStorageValue(cid,15209) == 1 then
selfSay('Your mission is simple,You must enter in the retreat and destruct the Shadow Nexus. Then report to me about your mission.', cid)
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())