Ir para conteúdo

Featured Replies

Postado

Então, eu to tendo um problema com o script de addon do pokexmonstyer, tipo, funciona e tal, mas quando eu uso a addon no poke, o cd bar dele some e só volta se eu clicar na pokebola de 1 pokemon que ta morto '-' ajudem por favor <3

 

Aqui o script

Spoiler
Spoiler

function onUse(cid, item, fromPosition, itemEx, toPosition)
 
    local addons = {
        [751] = {pokemon= "Electabuzz" , looktype = 1911, count = 1},
        [748] = {pokemon= "Charizard" , looktype = 1910, count = 1},
        [755] = {pokemon= "Blastoise" , looktype = 1909, count = 1},
        [754] = {pokemon= "Shiny Nidoking" , looktype = 1914, count = 1},
        [753] = {pokemon= "Arcanine" , looktype = 1908, count = 1},
        [752] = {pokemon= "Shiny Golem" , looktype = 1913, count = 1},
    }
 
    if #getCreatureSummons(cid) > 0 then
        doPlayerSendCancel(cid, "Please back your pokemon.")
        return false
    end
 
    local numero = addons[item.itemid].looktype
    local count = addons[item.itemid].count
 
    local pb = getPlayerSlotItem(cid, 8).uid
    local pk = addons[item.itemid].pokemon
 
    if pb <= 0 then
        doPlayerSendCancel(cid, "Desculpe, você não tem um "..pk.." no slot")
        return false
    end
 
    if getItemAttribute(pb,"poke") ~= pk then
        doPlayerSendCancel(cid, "Desculpe, você não pode usar esse addon nesse pokemon.")
        return false
    end
 
    local addon = tonumber(getItemAttribute(pb,"addon"))
    if not addon or addon < 1 then
        if doRemoveItem(item.uid, count) then
            doPlayerSendTextMessage(cid, 27, "Parabéns, você executou isso com sucesso. Para remover seu addon diga !addons remove")
            doSetItemAttribute(pb,"addon", numero)
        else
            doPlayerSendCancel(cid, "Você não tem o necessário para adicionar no seu "..pk..".")
        end
        return true
    end
    
    return true
end

 

 

  • Respostas 5
  • Visualizações 418
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Vamos Lá !   Em Data/actions e Actions.xml adiciona isto: <action itemid="IdAddon;IdAddon" event="script" value="Addon.lua"/>   Em IdAddon Coloca os ids dos items dos addon

Postado

Esta é uma mensagem automática! Este tópico foi movido para a área correta.
Pedimos que você leia as regras do fórum.

Spoiler

This is an automated message! This topic has been moved to the correct area.
Please read the forum rules.

 

Postado

 

 

Spoiler
Spoiler

Vamos Lá !

 

Em Data/actions e Actions.xml adiciona isto:

<action itemid="IdAddon;IdAddon" event="script" value="Addon.lua"/>

 

Em IdAddon Coloca os ids dos items dos addons! ai para adicionar mais ids é só colocar o ";" Ou seja aquele negocio verde, e depois colocar o ID Ficando:IdAddon;IdAddon;IdAddon e por ai vai
 
Ai Em Data/actions/scripts cria um arquivo lua Chamado "Addon" e Dentro Dele Adiciona Isto:

function onUse(cid, item, fromPosition, itemEx, toPosition)
                local addons = {
                [12593] = {pokemon= "Electabuzz" , looktype = 1482}, --xxxx = id do item do addon --- "Scyther" = nome do pokemon --- looktype = 1 é o looktype do pokemon com addon
                [12925] = {pokemon= "Alakazam" , looktype = 1471}, --xxxx = id do item do addon --- "Scyther" = nome do pokemon --- looktype = 1 é o looktype do pokemon com addon
               }
 
                if #getCreatureSummons(cid) > 0 then
                                doPlayerSendCancel(cid, "Please back your pokemon.")
                                return false
                end     
                local numero = addons[item.itemid].looktype
 
                local pb = getPlayerSlotItem(cid, 8).uid
                local pk = addons[item.itemid].pokemon
 
                if getItemAttribute(pb,"poke") ~= pk then
                                doPlayerSendCancel(cid, "Sorry, you can't use this addon on this poke.")
                return false
                end
 
                if getItemAttribute(pb,"addon") < 1 then
                                doRemoveItem(item.uid, 1)
                                doPlayerSendTextMessage(cid, 27, "Congratulations! Now your pokemon will use the addon.")
                                doSetItemAttribute(pb,"addon",numero)
                                return true
                end     
 
return true
end

 

 Para adicionar um Novo Addon é só Adicionar esta tag:

[ItemID] = {pokemon= "NomeDoPoke" , looktype = IdDaOutfit},

 

EM ItemID, troca pelo id do addon
em pokemon troca NomeDoPoke, pelo Nome Do Pokémon que vai ser adicionado o Addon
Em looktype, troca IdDaOutfit, pelo looktype do pokémon com addon!
 
Em Goback.lua
 
Procure Por: (fica lá no final)

else
 
    doPlayerSendCancel(cid, "This pokemon is fainted.")
 
end

 

E Adiciona Em cima do  else  Isto:

local pk = getCreatureSummons(cid)[1]
                local pb = getPlayerSlotItem(cid, 8).uid
                local look = getItemAttribute(pb,"addon")
                if not look then
                                doSetItemAttribute(pb,"addon",0) 

                end
                if look > 0 then
                                doSetCreatureOutfit(pk, {lookType = look}, -1)

                end

 

Em Catch system.lua Procura Por:

doItemSetAttribute(item, "description", description)

Em baixo adicione isto:

doItemSetAttribute(item, "addon", 0)

 

Em Some Functions.lua Procure Por:

unLock(item.uid)

Da Enter Duas Vezes e Adiciona isto:

local pk = getCreatureSummons(cid)[1]
local pb = getPlayerSlotItem(cid, 8).uid
local look = getItemAttribute(pb,"addon")
if not look then
doSetItemAttribute(pb,"addon",0)

end
if look > 0 then
doSetCreatureOutfit(pk, {lookType = look}, -1)

end

Credito samlecter

 

Editado por wougoplex (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