Ir para conteúdo

Featured Replies

Postado
  • Autor

UP

  •               6oI4lwi.gif
  • FusionPoké Estará aberto este mês para testes !
  • Curta A Page e Fique Por Dentro Das Novidades Do Servidor!   Like Aqui!
  •                         qNmeLvu.png
  • Respostas 15
  • Visualizações 883
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local config, buyPoke = {     diamondId = xxx,                    --ID do diamond.     pokemons = {         ["pokemon_name"] = price,       --["nome_do_pokémon"] = preço,         ["pokemon_name"] = pr

  • Ops. Código corrigido.

  • Falta de atenção minha. Código corrigido. Agora vai funcionar perfeitamente.

Postado
  • Autor
Oks !
Eu só não coloco pelo otc pq quero que só premium account tenha acesso a esse npc
Então colocarei ele na area VIP !
 
 
Se puder atender ao meu outro pedido, o do sistema de comprar casas
meus REP+ de hj serão todos seus !

Editado por J.L (veja o histórico de edições)

  •               6oI4lwi.gif
  • FusionPoké Estará aberto este mês para testes !
  • Curta A Page e Fique Por Dentro Das Novidades Do Servidor!   Like Aqui!
  •                         qNmeLvu.png
Postado
local config, buyPoke = {
    diamondId = xxx,                    --ID do diamond.
    pokemons = {
        ["pokemon_name"] = price,       --["nome_do_pokémon"] = preço,
        ["pokemon_name"] = price,       --["nome_do_pokémon"] = preço,
        ["pokemon_name"] = price,       --["nome_do_pokémon"] = preç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
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
    if msgcontains(msg:lower(), "buy") or msgcontains(msg:lower(), "trade") then
        local str = ""
        for poke, price in pairs(config.pokemons) do
            if str == "" then
                str = poke.." - "..price.." diamonds"
            else
                str = str.."\n"..poke.." - "..price.." diamonds"
            end
        end
        selfSay("Hello, I sell this pokemons. Wanna buy any of them?", cid)
        doPlayerPopupFYI(cid, "Selling:\n"..str)
        talkState[talkUser] = 1
        return true
    elseif msgcontains(msg:lower(), "yes") then
        if talkState[talkUser] == 1 then
            selfSay("Tell me the name, please.", cid)
            talkState[talkUser] = 2
            return true
        elseif talkState[talkUser] == 3 then
            if buyPoke ~= "" then
                local price = config.pokemons[buyPoke]
                if doPlayerRemoveItem(cid, config.diamondId, price) then
                    selfSay("Here's your "..buyPoke.."!", cid)
                    addPokeToPlayer(cid, buyPoke, 0, 1, "normal", true)
                    talkState[talkUser] = 0
                    return true
                else
                    selfSay("You do not have "..price.." diamonds.", cid)
                    talkState[talkUser] = 0
                    return true
                end
            end
        end
    elseif config.pokemons[msg] and talkState[talkUser] == 2 then
        selfSay("You really wanna buy a "..msg.."? It will cost you "..config.pokemons[msg].." diamonds.", cid)
        buyPoke = msg
        talkState[talkUser] = 3
        return true
    elseif msgcontains(msg:lower(), "no") then
        selfSay("Then bye.", cid)
        talkState[talkUser] = 0
        return true
    end
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Editado por zipter98 (veja o histórico de edições)

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

Postado
  • Autor

Cara quando eu vo spawnar o npc da esse erro aki

 

BRJtSRa.png

  •               6oI4lwi.gif
  • FusionPoké Estará aberto este mês para testes !
  • Curta A Page e Fique Por Dentro Das Novidades Do Servidor!   Like Aqui!
  •                         qNmeLvu.png

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