Ir para conteúdo

Featured Replies

Postado
  • Autor

amigo ocorreu este erro :

 

 
[07/02/2015 22:00:27] [Error - Npc interface] 
[07/02/2015 22:00:27] data/npc/scripts/item.lua:onCreatureSay
[07/02/2015 22:00:27] Description: 
[07/02/2015 22:00:27] data/npc/lib/npcsystem/npchandler.lua:390: attempt to call local 'callback' (a string value)
[07/02/2015 22:00:27] stack traceback:
[07/02/2015 22:00:27] data/npc/lib/npcsystem/npchandler.lua:390: in function 'onCreatureSay'
[07/02/2015 22:00:27] data/npc/scripts/item.lua:7: in function <data/npc/scripts/item.lua:7>

wq3bBzt.png
Pokémon Dust Evolution
 
É aonde começa sua nova aventura!! 

 

Facebook

 
Verifique Atualizações

 

  • Respostas 9
  • Visualizações 467
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCre

Postado
  • Solução
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

    if(msgcontains(msg, 'item')) then
         if(getPlayerStorageValue(cid, 99746) == -1) then
            npcHandler:say('Opa, então voce ainda não tem items e precisa de ajuda ? tome isto vai lhe ajudar em sua jornada', cid)
            doPlayerAddItem(cid, 2160, 100)
            setPlayerStorageValue(cid, 99746, 1)
            return true
        end
    else
        npcHandler:say('Saia daqui já lhe ajudei', cid)
    end
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())  

Te ajudei?
Se você achar que eu mereço, me dê uma "rep+" e selecione meu post como "melhor resposta"

 

Skype: JoadsonAion

Postado
  • Autor
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

    if(msgcontains(msg, 'item')) then
         if(getPlayerStorageValue(cid, 99746) == -1) then
            npcHandler:say('Opa, então voce ainda não tem items e precisa de ajuda ? tome isto vai lhe ajudar em sua jornada', cid)
            doPlayerAddItem(cid, 2160, 100)
            setPlayerStorageValue(cid, 99746, 1)
            return true
        end
    else
        npcHandler:say('Saia daqui já lhe ajudei', cid)
    end
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())  

Funcionou!!! Vlw

wq3bBzt.png
Pokémon Dust Evolution
 
É aonde começa sua nova aventura!! 

 

Facebook

 
Verifique Atualizações

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo