Ir para conteúdo

Featured Replies

Postado

Olá galera, editei um npc aqui para oque eu precisava, e agora ele ta dando erro, será que alguém conseguiria me ajudar? tfs 1.2

 

 

Script do npc

 



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 item = {{21699, 1} {24301, 1} {21699, 1}} --id do item, quantidade

function creatureSayCallback(cid, type, msg)
    local msg, player = string.lower(msg), Player(cid)
    if not npcHandler:isFocused(cid) then
        if isInArray({"hi", "hello"}, msg) then
            npcHandler:addFocus(cid)
            if player:getStorageValue(56473) == -1 then
                if player:getStorageValue(56473) == -1 then
                    npcHandler:say("Hi, ".. player:getName().."! hello young warrior, I realized that you are looking for some adventures, if you can {help} me I can ask one of my servants to take you to a mysterious island.?", cid)
                    npcHandler.topic[cid] = 1
                elseif
                    npcHandler:say("help, ".. player:getName().."! So you are interested? well, what I ask is simple, I have lost 3 chests with personal treasures through the forest, manholes and building, can you bring me the items that they contain??", cid)
                    npcHandler.topic[cid] = 2
                else
                    npcHandler:say("Hi, ".. player:getName().."! Can you find my treasures?", cid)
                    npcHandler.topic[cid] = 3
                end
            else
                npcHandler:say("I have already told my servant that I can help you to reach such an island.", cid)
                npcHandler.topic[cid] = 0
                npcHandler:releaseFocus(cid)
            end
        else
            return false 
        end
    elseif msgcontains(msg, "yes") and npcHandler.topic[cid] == 1 then
        player:setStorageValue(56473, 1)
        npcHandler:say("Ok, now I will wait for you. Be careful!", cid)
        npcHandler.topic[cid] = 0
        npcHandler:releaseFocus(cid)
    elseif msgcontains(msg, "yes") and npcHandler.topic[cid] == 2 then
        player:setStorageValue(56473, 1)
        npcHandler:say("Ok, now I will wait for you. Be careful!", cid)
        npcHandler.topic[cid] = 0
        npcHandler:releaseFocus(cid)
    elseif msgcontains(msg, "yes") and npcHandler.topic[cid] == 3 then
        if player:removeItem(items[1], items[2]) then
            player:setStorageValue(56473, 1)
            npcHandler:say("Thanks! I'll tell my servant that I can take you to the island.", cid)
            npcHandler.topic[cid] = 0
        else
            npcHandler:say("Sorry, but you still have not found all my treasures.", cid)
            npcHandler.topic[cid] = 0
        end
    elseif msgcontains(msg, "no") and npcHandler.topic[cid] == 2 then
        npcHandler:say("Ok, I will wait a bit more.", cid)
         npcHandler.topic[cid] = 0
    elseif msgcontains(msg, "bye") then
        npcHandler:say("Bye.", cid)
        npcHandler:releaseFocus(cid)
    else
        npcHandler:say("What?", cid)
         npcHandler.topic[cid] = 0
    end
    return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

Resolvido por Bruno Carvalho

Ir para solução
  • Respostas 13
  • Visualizações 865
  • Created
  • Última resposta

Top Posters In This Topic

Posted Images

Postado

Qual erro ocorre? 

Bruno Carvalho / Ex-Administrador TibiaKing

[email protected]

 

Em 26/12/2016 em 03:47, Spraypaint disse:

A força da alienação vem dessa fragilidade dos indivíduos, quando apenas conseguem identificar o que os separa e não o que os une.

-miltinho

 

wMwSJFE.png?1

 

Postado
  • Autor

@Bruno Carvalho esse aqui, tentei mudar ou tirar e acaba dando erro em outra parte

 


[Warning - NpcScript::NpcScript] Can not load script: Archery.lua
data/npc/scripts/Archery.lua:6: '}' expected near '{'

 

 

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