Ir para conteúdo

Featured Replies

Postado

abrindo serve 8.0, antes de abrir fui testa os npc que foi colocado novo

 

era para o player compra os addons trocando pelos itens necessários, o npc pega o item, mais não da o addons para o players,

e se o player tenta pegar de novo, o npc avisa que a pessoa já está com a quele addons.

achei que o problema era o código, então abri o script do npc, e estava certo o código, tentei com outros npc e estava com o mesmo problema, vou colocar aqui em baixo o Script de 1 npc de addons, quem souber e poder dá uma mãozinha, agradeço de já ^^.

 

 

 

 

 

citizen 1

 

local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
 
function onThingMove(creature, thing, oldpos, oldstackpos)
 
end
 
 
function onCreatureAppear(creature)
 
end
 
 
function onCreatureDisappear(cid, pos)
  if focus == cid then
          selfSay('Good bye then.')
          focus = 0
          talk_start = 0
  end
end
 
 
function onCreatureTurn(creature)
 
end
 
 
function msgcontains(txt, str)
  return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
 
 
function onCreatureSay(cid, type, msg)
  msg = string.lower(msg)
 
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
  selfSay('Hiho ' .. getCreatureName(cid) .. ' Eu posso lhe oferecer o Citizen Addon 1, diga help para mais infos.')
  focus = cid
  talk_start = os.clock()
 
  elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')
 
elseif focus == cid then
talk_start = os.clock()
 
if msgcontains(msg, 'help') then
selfSay('Eu libero o Citizen Addon 1 , se estiver interessado diga: citizen cloth')
 
 
elseif msgcontains(msg, 'citizen cloth') then
                 if getPlayerStorageValue(cid,8000) >= 2 then
selfSay('Voce ja tem esse addon.')
 
                 else if getPlayerStorageValue(cid,8000) == 1 then
                    selfSay('Precisarei de 100 Minotaur Leathers, voce as trouxe?')
addon_state = 2
else
           setPlayerStorageValue(cid,8000,1)
                    selfSay('Precisarei de 100 Minotaur Leathers, voce as trouxe?')
        end
end
elseif msgcontains(msg, 'yes') and addon_state == 2 then
                 if doPlayerRemoveItem(cid,5878,100) == 0 then
  selfSay('Sorry, you not have them.')
                 else  
selfSay('Prontinho, voce adquiriu o Citizen Addon 1.')
if getPlayerSex(cid) == 0 then
   doPlayerAddOutfit(cid, 136, 1)
   setPlayerStorageValue(cid,8000,2)
else
addon(cid, 128, 1)
setPlayerStorageValue(cid,8000,2)
   talk_state = 1
end
        end
 
 
        elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
            selfSay('Adeus ' .. creatureGetName(cid) .. ', Volte Sempre.')
            focus = 0
            talk_start = 0
 
        elseif msg ~= "" then
            selfSay('Como? Eu não entendi!')
            talk_state = 0
        end
    end
end
 
function onCreatureChangeOutfit(creature)
end
 
function onThink()
    doNpcSetCreatureFocus(focus)
    if (os.clock() - talk_start) > 30 then
        if focus > 0 then
            selfSay('Proximo!!...')
        end
        focus = 0
        talk_start = 0
    end
    if focus ~= 0 then
        if getDistanceToCreature(focus) > 5 then
            selfSay('Good Bye')
            focus = 0
            talk_start = 0
        end
    end
end
 
  • Respostas 6
  • Visualizações 578
  • Created
  • Última resposta

Top Posters In This Topic

Postado

vai na pasta do servidor l data l xml e verifique os id dos outfit    doPlayerAddOutfit(cid, 136, 1) deve estar errado a id do outfit.

 

 

Se lhe ajudei REP+

 

 

HEitWql.png

 

http://www.tibiaking...r/116764-texau/

 

 hservers2.png

 

[email protected] (Atendimento 24hrs via ticket ou por email)

Skype Ainda não temos!

Faça um orçamento sem compromisso, Te esperamos lá,

Atenciosamente, Equipe HServers.

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

Se lhe Ajudei REP+  :huh: 

HEitWql.png

 

http://www.tibiaking.com/forum/user/116764-texau/

 

 

 bannerhs.png

 

[email protected] (Atendimento 24hrs via ticket ou por email)

Skype Ainda não temos!

Faça um orçamento sem compromisso, Te esperamos lá,

Atenciosamente, Equipe HServers.

Postado

achei estranho se for female ele da outfit se for male ele da addon.

Postado

eu vi isso, ta certinho, isso que achei estranho, ele tipo, te da o addons mais tu não pode usar, ou não aparece de opção para ti usar ele

então não e o npc que esta bugado. e sim seu Ot

Se lhe Ajudei REP+  :huh: 

HEitWql.png

 

http://www.tibiaking.com/forum/user/116764-texau/

 

 

 bannerhs.png

 

[email protected] (Atendimento 24hrs via ticket ou por email)

Skype Ainda não temos!

Faça um orçamento sem compromisso, Te esperamos lá,

Atenciosamente, Equipe HServers.

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