Ir para conteúdo

Featured Replies

Postado
  • Autor

Coloquei assim e não funcionou:

 

elseif msgcontains(msg, 'assassin') then
if getPlayerItemCount(cid,15515) >= 25 then
npcHandler:say('Did you bring me the 25 bar of golds?', cid)
npcHandler.topic[cid] = 45
else
npcHandler:say('I need a {25 bar of golds}, to give you addon assassin. Please come back when you have them.', cid)
npcHandler.topic[cid] = 0
end
elseif msgcontains(msg, 'yes') and npcHandler.topic[cid] == 46 then
npcHandler.topic[cid] = 0
if getPlayerItemCount(cid,15515) >= 25 then
if doPlayerRemoveItem(cid,15515, 25) == TRUE then
npcHandler:say(done, cid)
                                                                          local player = player(cid)
                                                                          player:addOutfitAddon(152, 3)
end
else
npcHandler:say(item, cid)
end
  • Respostas 16
  • Visualizações 987
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Cara, re-vê seus códigos, tem bastante coisa errada...   @Topic Tenta assim: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameter

Postado

tem como enviar o script completo ?

Ando devagar, porque já tive pressa. E levo esse sorriso, porque já chorei demais...

________________________________________________________________________________

Minhas Sprites:

Mega Metagross

Mega Abomasnow

Pack de Shinys

[Posso atualizá-lo com novos shinys a qualquer momento]

Tutoriais:

[Completo] Criando e adicionando um novo Pokémon

[Actions] Criando quest no RME

Editores Lua/Xml/Sync Entre outros:

Editores Win/Mac/Linux

Postado
  • Autor
Script do NPC
 
 
 
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
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 = 'I\'m sorry, but you do not have the required items for this trade.'
local done = 'Here you are, thank you for your business.'
 
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
 
if msgcontains(msg, 'items') then
npcHandler:say('I sell items for bar of golds, i have: {boots of waterwalking}, {furious} {frock}, {umbral master spellbook}, {umbral master crossbow}, {umbral} {master} {slayer}, {umbral master} {chopper}, {umbral master hammer}, {umbral master bow}, {umbral master} {mace}, {umbral master axe}, {umbral} {masterblade}, {change sex}, {remover} {skull}, {sweet mangonaise elixir}.', cid)
elseif msgcontains(msg, 'addons') then
npcHandler:say('I sell addons for bar of golds, i have: {assassin}, {warrior}, {barbarian}, {druid}, {brotherhood}, {entrepreneur}, {dream warden}, {glooth engineer}, {conjurer}, {death herald}, {ceremonial} {garb}, {chaos acolyte}, {beastmaster}, {ranger}, {puppeteer}, {spirit caller} and {champion}.', cid)
elseif msgcontains(msg, 'mounts') then
npcHandler:say('I sell mounts for bar of golds, i have: {ursagrodon}, {walker}, {armoured war} {horse}, {shadow draptor}, {azudocus}, {blazebringer}, {carpacosaurus}, {crimson ray}, {death crawler}, {desert} {king}, {flamesteed}, {winter} { king}, {jade pincer}, {platesaurian}, {tempest}, {tombstinger}, {nethersteed}, {jade lion}, {steelbreak}, {floating kashmir}, {magic carpet}, {flying divian}, {night} {waccoon}, {ringtail waccoon}, {emerald} {waccoon}, {blackpelt}, {siegebreaker}, {poisonbane}, {doombringer}, {woodland prince}, {hailtorm fury}.', cid)
elseif msgcontains(msg, 'assassin') then
if getPlayerItemCount(cid,15515) >= 25 then
npcHandler:say('Did you bring me the 25 bar of golds?', cid)
npcHandler.topic[cid] = 45
else
npcHandler:say('I need a {25 bar of golds}, to give you addon assassin. Please come back when you have them.', cid)
npcHandler.topic[cid] = 0
end
elseif msgcontains(msg, 'yes') and npcHandler.topic[cid] == 46 then
npcHandler.topic[cid] = 0
if getPlayerItemCount(cid,15515) >= 25 then
if doPlayerRemoveItem(cid,15515, 25) == TRUE then
npcHandler:say(done, cid)
                                                                          local player = player(cid)
                                                                          player:addOutfitAddon(152, 3)
end
else
npcHandler:say(item, cid)
end
elseif msgcontains(msg, 'no') and npcHandler.topic[cid] >= 1 and npcHandler.topic[cid] <= 90 then
npcHandler:say('Well, then leave.')
npcHandler.topic[cid] = 0
end
 
return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Alguém?

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

Postado
  • Solução

tem como enviar o script completo ?

Cara, re-vê seus códigos, tem bastante coisa errada...

 

@Topic

Tenta assim:

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
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 = 'I\'m sorry, but you do not have the required items for this trade.'
local done = 'Here you are, thank you for your business.'
 
function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return true
    end
 
    if msgcontains(msg, 'items') then
        npcHandler:say('I sell items for bar of golds, i have: {boots of waterwalking}, {furious} {frock}, {umbral master spellbook}, {umbral master crossbow}, {umbral} {master} {slayer}, {umbral master} {chopper}, {umbral master hammer}, {umbral master bow}, {umbral master} {mace}, {umbral master axe}, {umbral} {masterblade}, {change sex}, {remover} {skull}, {sweet mangonaise elixir}.', cid)
    elseif msgcontains(msg, 'addons') then
        npcHandler:say('I sell addons for bar of golds, i have: {assassin}, {warrior}, {barbarian}, {druid}, {brotherhood}, {entrepreneur}, {dream warden}, {glooth engineer}, {conjurer}, {death herald}, {ceremonial} {garb}, {chaos acolyte}, {beastmaster}, {ranger}, {puppeteer}, {spirit caller} and {champion}.', cid)
    elseif msgcontains(msg, 'mounts') then
        npcHandler:say('I sell mounts for bar of golds, i have: {ursagrodon}, {walker}, {armoured war} {horse}, {shadow draptor}, {azudocus}, {blazebringer}, {carpacosaurus}, {crimson ray}, {death crawler}, {desert} {king}, {flamesteed}, {winter} { king}, {jade pincer}, {platesaurian}, {tempest}, {tombstinger}, {nethersteed}, {jade lion}, {steelbreak}, {floating kashmir}, {magic carpet}, {flying divian}, {night} {waccoon}, {ringtail waccoon}, {emerald} {waccoon}, {blackpelt}, {siegebreaker}, {poisonbane}, {doombringer}, {woodland prince}, {hailtorm fury}.', cid)
    elseif msgcontains(msg, 'assassin') then
        if getPlayerItemCount(cid,15515) >= 25 then
            npcHandler:say('Did you bring me the 25 bar of golds?', cid)
            npcHandler.topic[cid] = 45
        else
            npcHandler:say('I need a {25 bar of golds}, to give you addon assassin. Please come back when you have them.', cid)
            npcHandler.topic[cid] = 0
        end
    elseif msgcontains(msg, 'yes') and npcHandler.topic[cid] == 46 then
        npcHandler.topic[cid] = 0
        if getPlayerItemCount(cid,15515) >= 25 then
            if doPlayerRemoveItem(cid,15515, 25) then
                npcHandler:say(done, cid)
                local player = Player(cid)
                player:addOutfitAddon(152, 3)
            end
        else
            npcHandler:say(item, cid)
        end
    elseif msgcontains(msg, 'no') and npcHandler.topic[cid] >= 1 and npcHandler.topic[cid] <= 90 then
        npcHandler:say('Well, then leave.')
        npcHandler.topic[cid] = 0
    end
 
    return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
                              _
                          .-'` `}
                  _./)   /       }
                .'o   \ |       }
                '.___.'`.\    {`
                /`\_/  , `.    }                                      ME DA UMA NOZ!
                \=' .-'   _`\  {
                 `'`;/      `,  }
                    _\   @   ;  }
                   /__`;-...'--'

Cluck!

Postado
  • Autor

Tipo, fiz uma lista de items e de mounts e eles são entregues tudo normal, mas quando tento colocar pra entregar addon ele não entrega e fica com os items..


Wakon, o npc não aceita o comando "yes" quando tento comprar o item.


Wakon, deixa já resolvi. Era o npcHandler.topic[cid] = 1 que estava com um numero diferente do elseif msgcontains(msg, 'yes') and npcHandler.topic[cid] == 1 then

 

Quase resolvido..

Editado por arthur122222 (veja o histórico de ediçõ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