Postado Maio 4, 2020 5 anos .Qual servidor ou website você utiliza como base? TFS 0.3.3 Qual o motivo deste tópico? A quest funciona ok se for feita em sequencia mas se vc der bye pro npc e voltar ele nao termina a quest, alguem pode ajudar plz?? Está surgindo algum erro? Se sim coloque-o aqui. Citar Você tem o código disponível? Se tiver publique-o aqui: Citar 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 local storage = 5009 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, 'carta') or msgcontains(msg, 'mission')) then if getPlayerStorageValue(cid, storage) == -1 then selfSay("Como voce sabe sobre essa carta, voce a encontrou?", cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, storage) == 1 then selfSay("Achou?", cid) talkState[talkUser] = 1 else selfSay("Eu sei a {senha} da pirata que vive em cima da loja do Dark Rodo.", cid) end elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, storage) == -1 then selfSay("JURA? POSSO VER?", cid) setPlayerStorageValue(cid, storage, 1) else if(doPlayerRemoveItem(cid, 5802, 1)) then selfSay("Do caralho! Bem, voce eh um cara legal entao vou te pedir um favor. Tome essa chave e va atras do {item mais valioso} daquele chapeleiro maluco, ele esconde em algum quarto secreto naquela ilha, voce deve saber qual item e. Ah ja ia esquecendo, entregue esse convite pra minha prima.", cid) doSetItemActionId(doPlayerAddItem(cid, 2088, 1), 1004) doPlayerAddItem(cid, 6387, 1) doPlayerAddExp(cid, 5000) setPlayerStorageValue(cid, storage, 2) else selfSay("Cade?.", cid) end end elseif (msgcontains(msg, 'hat') or msgcontains(msg, 'hat of the mad')) and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, storage) == 2 then if(doPlayerRemoveItem(cid, 2323, 1)) then selfSay("Muito obrigada! Pegue esta mascara que ganhei de uma amiga.", cid) doPlayerAddItem(cid, 9778, 1) doPlayerAddExp(cid, 5000) setPlayerStorageValue(cid, storage, 3) else selfSay("Han?", cid) end end talkState[talkUser] = 0 elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then selfSay("Ta bom...", cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
Postado Maio 4, 2020 5 anos @robsu Boa tarde, tente assim: Spoiler 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 local storage = 5010 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, 'carta') or msgcontains(msg, 'mission')) then if getPlayerStorageValue(cid, storage) == -1 then selfSay("Como voce sabe sobre essa carta, voce a encontrou?", cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, storage) == 1 then selfSay("Achou?", cid) talkState[talkUser] = 1 else selfSay("Eu sei a {senha} da pirata que vive em cima da loja do Dark Rodo.", cid) end elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, storage) == -1 then selfSay("JURA? POSSO VER?", cid) setPlayerStorageValue(cid, storage, 1) else if(doPlayerRemoveItem(cid, 5802, 1)) then selfSay("Do caralho! Bem, voce eh um cara legal entao vou te pedir um favor. Tome essa chave e va atras do {item mais valioso} daquele chapeleiro maluco, ele esconde em algum quarto secreto naquela ilha, voce deve saber qual item e. Ah ja ia esquecendo, entregue esse convite pra minha prima.", cid) doSetItemActionId(doPlayerAddItem(cid, 2088, 1), 1004) doPlayerAddItem(cid, 6387, 1) doPlayerAddExp(cid, 5000) setPlayerStorageValue(cid, storage, 2) else selfSay("Cade?.", cid) end end elseif (msgcontains(msg, 'hat') or msgcontains(msg, 'hat of the mad')) and getPlayerStorageValue(cid, storage) == 2 then if(doPlayerRemoveItem(cid, 2323, 1)) then selfSay("Muito obrigada! Pegue esta mascara que ganhei de uma amiga.", cid) doPlayerAddItem(cid, 9778, 1) doPlayerAddExp(cid, 5000) setPlayerStorageValue(cid, storage, 3) talkState[talkUser] = 0 else selfSay("Han?", cid) end talkState[talkUser] = 0 elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then selfSay("Ta bom...", cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.