Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Olá, eu não sei mexer com npcs, geralmente eu pego um e edito até ficar do jeito que eu quero, mas infelizmente eu não consegui chegar nem perto de colocar oque eu queria que o npc fizesse, então venho aqui pedir ajuda a vocês.

 

O dialogo é o seguinte:

Player: hi

Npc: Hi, i can teleport you to the tutorial area.

Player: tutorial area

Npc: In the tutorial area you'll be shown how to properly use your fishind rod. Do you want to be teleported?

Player: yes

 

E o npc teleportaria esse jogador pra uma area xxxx xxxx x, e eu queria que fosse apenas UMA vez por jogador, acho que é com storage que faz isso mah eu nao entendo nada. 

 

obg desde ja.

Postado

Sabe fazer o arquivo XML?

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_DEFAULT and 0 or cid
    local toPos = {x = x, y = y, z = z}       --Para onde o jogador será teleportado.
    local storage = 8191
    if msgcontains(msg:lower(), "tutorial area") or msgcontains(msg:lower(), "tutorial") then
        if getPlayerStorageValue(cid, storage) > -1 then
            selfSay("You already did the tutorial.", cid)
            talkState[talkUser] = 0
            return true
        else
            selfSay("In the tutorial area you'll be shown how to properly use your fishind rod. Do you want to be teleported?", cid)
            talkState[talkUser] = 1
            return true
        end
    elseif msgcontains(msg:lower(), "yes") and talkState[talkUser] == 1 then
        selfSay("Good luck.", cid)
        doTeleportThing(cid, toPos)
        setPlayerStorageValue(cid, storage, 1)
        talkState[talkUser] = 0
        return true
    elseif msgcontains(msg:lower(), "no") and talkState[talkUser] == 1 then
        selfSay("Ok...", cid)
        talkState[talkUser] = 0
        return true
    end
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())            

não respondo pms solicitando suporte em programação/scripting

Postado
  • Autor

Sei sim, muito obrigado, funcionou perfeitamente. REP+

 

Você poderia me ajudar com outro npc agora? Acho desnecessário criar outro tópico.

 

O npc faria o seguinte:

 

Ao falar Hi/Tutorial ele te emprestaria uma fishing rod (2580) por 5m, assim como o outro que você fez, só seria possivel conseguir uma vara por player. 

 

Desculpa se to pedindo demais, é que minha área é mapping e eu fico super perdido com esse tipo de script. 

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