Ir para conteúdo

Featured Replies

Postado

Olá galera do TK! :wow:

 

Gostaria de uma ajuda no seguinte script

function onUse(cid, item, frompos, item2, topos)

        if item.uid == 4113 then
          if getPlayerItemCount(cid,2476) >= 5 then
      doPlayerRemoveItem(cid,2476,5)
      doPlayerRemoveItem(cid,2477,5)
      doPlayerRemoveItem(cid,2396,5)
        queststatus = getPlayerStorageValue(cid,100004)
        if queststatus == -1 then
        doPlayerSendTextMessage(cid,22,"You won a full knight addon!")
                doSendAnimatedText(getPlayerPosition(cid), "", TEXTCOLOR_ORANGE)
                doPlayerAddOutfit(cid,139,3)
                doPlayerAddOutfit(cid,131,3)
        setPlayerStorageValue(cid,100004,1)
        else
        doPlayerSendTextMessage(cid,22,"You own this addon!")
        end
        else
        doPlayerSendTextMessage(cid,22,"You do not have the items needed to make the addon!")
        end
        else
        return 0
        end

        return 1
        end

ps: (não sei colocar spoiler nesse editor)

 

Como funciona:

Coloquei o UniqueID em uma alavanca, que ao clicar nesta alavanca, ela removerá os items (knight armor, knight legs e ice rapiers (5x cada), e lhe dará o addon de Knight !

Porém, está com um bug, que só confere a knight armor, se o cara estiver com apenas 5 knights armor, ele consegue concluir o addon !

Provavelmente o error está entre as linhas 3 à 6 .. e não consigo arrumar!

 

Me ajudem a resolver este problema por favor, e disponibilizar este script pra galera do TK !
Sistema testado TFS 0.3.6 - Tibia 8.6

 

Vale REP + :D

 

 

Programador/Scripter/Mapper nível NOOB ?

 

Untitltasadasded-1.png.e24703844a8ee56fadbf0cdcf82cd9c7.png

  • Respostas 17
  • Visualizações 735
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • O erro do distro é porque tava if getPlayerItemCount(cid, itens) = 1 then onde no caso deveria ser "==", pois o "=" serve pra definir algo, enquanto == é pra conferir se ta igual a x.

Postado

Como você pode ver na quarta linha>           if getPlayerItemCount(cid,2476) >= 5 then         <  O count só está configurada para a knight armor, adicione count para os outros.

Meu Conteúdo no TK:

 

Sources 8.6x, 8.7x, 9.x

 

Naruto Sprites

 

 

Se eu lhe ajudar, você reconhecer que ajudei, mas não der Rep+, não espere por ajuda na próxima duvida.

 

aODwHkU.png

 

Postado
  • Autor

Sempre que eu adiciona da error !
Pode dar um exemplo de como faz sem dar error ?

 

////edit

function onUse(cid, item, frompos, item2, topos)

        if item.uid == 4113 then
          if getPlayerItemCount(cid,2476) >= 5 then
      doPlayerRemoveItem(cid,2476,5)
          if getPlayerItemCount(cid,2477) >= 5 then
      doPlayerRemoveItem(cid,2477,5)
          if getPlayerItemCount(cid,2396) >= 5 then
      doPlayerRemoveItem(cid,2396,5)
        queststatus = getPlayerStorageValue(cid,100004)
        if queststatus == -1 then
        doPlayerSendTextMessage(cid,22,"You won a full knight addon!")
                doSendAnimatedText(getPlayerPosition(cid), "", TEXTCOLOR_ORANGE)
                doPlayerAddOutfit(cid,139,3)
                doPlayerAddOutfit(cid,131,3)
        setPlayerStorageValue(cid,100004,1)
        else
        doPlayerSendTextMessage(cid,22,"You own this addon!")
        end
        else
        doPlayerSendTextMessage(cid,22,"You do not have the items needed to make the addon!")
        end
        else
        return 0
        end

        return 1
        end

faço assim e da error no script !
daquele outro jeito o script dá certo..mas buga !

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

 

Programador/Scripter/Mapper nível NOOB ?

 

Untitltasadasded-1.png.e24703844a8ee56fadbf0cdcf82cd9c7.png

Postado

Nuss fiz esse teste

 

script

function onUse(cid, item, frompos, item2, topos)
local itens = {2476, 2477, 2396}

if item.uid == 4113 then
  if getPlayerItemCount(cid, itens) >= 5 then
      doPlayerRemoveItem(cid, itens, 5)
        queststatus = getPlayerStorageValue(cid,100004)
if queststatus == -1 then
    doPlayerSendTextMessage(cid,22,"Você ganhou um addon cavaleiro completo!")
      doSendAnimatedText(getPlayerPosition(cid), "", TEXTCOLOR_ORANGE)
      doPlayerAddOutfit(cid, 139,3)
       doPlayerAddOutfit(cid, 131,3)
        setPlayerStorageValue(cid,100004,1)
else
    doPlayerSendTextMessage(cid,22,"Você já possui este addon!")
end


else
    doPlayerSendTextMessage(cid,22,"Você não tem os itens necessários para fazer o addon!")
end
else
return 0
end


return 1
end

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

Conteúdos Tragos Por Mim ao Fórum:

Venda de Vocações [Modern Aac] •

• Comando !Saga 

• [Modern Aac] DragonBall 

• Esconder •

• Naruto 2018

• • •

• •

'NtoProject - Breve'

[Show OFF] Disponível

Postado
  • Autor

Vou testar aqui alan, e já dou a resposta ! ;D

 

/////edit

Alan, deu certo! Porém, tipo estou fazendo isso com todos os addons, dai na opção de quantidade tem algumas falhas..

function onUse(cid, item, frompos, item2, topos)

        if item.uid == 4112 then
          if getPlayerItemCount(cid,2160) >= 25 then
      doPlayerRemoveItem(cid,2160,25)
      doPlayerRemoveItem(cid,2189,1)
      doPlayerRemoveItem(cid,2191,1)
      doPlayerRemoveItem(cid,2187,1)
      doPlayerRemoveItem(cid,2190,1)
      doPlayerRemoveItem(cid,2181,1)
      doPlayerRemoveItem(cid,2188,1)
      doPlayerRemoveItem(cid,8921,1)
        queststatus = getPlayerStorageValue(cid,100003)
        if queststatus == -1 then
        doPlayerSendTextMessage(cid,22,"You won a full mage addon!")
                doSendAnimatedText(getPlayerPosition(cid), "", TEXTCOLOR_ORANGE)
                doPlayerAddOutfit(cid,138,3)
                doPlayerAddOutfit(cid,120,3)
        setPlayerStorageValue(cid,100003,1)
        else
        doPlayerSendTextMessage(cid,22,"You own this addon!")
        end
        else
        doPlayerSendTextMessage(cid,22,"I need 1 wand of cosmic energy, 1 wand of draconia, 1 wand of dragonbreath, 1 wanf of inferno, 1 wand of vortex, 1 terra rod, 1 common akilles wand and more 250.000 cash for this addon!")
        end
        else
        return 0
        end

        return 1
        end

Por exemplo esse, que remove 1 wand de cada, e 25 crystal coins .. como eu faria para funcionar pelo 'local items' ?

 

 

//////edit

 

 

acho que vou fazer um local itens2 .. será que da certo ?

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

 

Programador/Scripter/Mapper nível NOOB ?

 

Untitltasadasded-1.png.e24703844a8ee56fadbf0cdcf82cd9c7.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.6k

Informação Importante

Confirmação de Termo