Ir para conteúdo
  • Cadastre-se

(Resolvido)Script com erros na distro


Ir para solução Resolvido por Orochi Elf,

Posts Recomendados

toda vez que uso esse item da script da esse erro na distro

 

erro

[12/08/2014 11:48:49] [Error - Action Interface] 
[12/08/2014 11:48:49] data/actions/scripts/Shiny stone.lua:onUse
[12/08/2014 11:48:50] Description: 
[12/08/2014 11:48:50] (luaDoItemSetAttribute) Item not found
 
[12/08/2014 11:48:50] [Error - Action Interface] 
[12/08/2014 11:48:50] data/actions/scripts/Shiny stone.lua:onUse
[12/08/2014 11:48:50] Description: 
[12/08/2014 11:48:50] (luaDoItemSetAttribute) Item not found
 
[12/08/2014 11:48:50] [Error - Action Interface] 
[12/08/2014 11:48:50] data/actions/scripts/Shiny stone.lua:onUse
[12/08/2014 11:48:50] Description: 
[12/08/2014 11:48:50] data/actions/scripts/Shiny stone.lua:32: attempt to index local 'getShinyPokeballs' (a nil value)
[12/08/2014 11:48:50] stack traceback:
[12/08/2014 11:48:50]  data/actions/scripts/Shiny stone.lua:32: in function <data/actions/scripts/Shiny stone.lua:13>
 

 

script

local evo = {
                          
["Charizard"] = {"Shiny Charizard", 1},
}
local balls = {
[2394] = {newBall = 2394},
[2391] = {newBall = 2391},
[2393] = {newBall = 2393},
[2392] = {newBall = 2392},
[12617] = {newBall = 12617},
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
          local monster = getCreatureName(itemEx.uid)
          if evo[monster] then  
                 if getPlayerItemCount(cid, item.itemid) >= evo[monster][2] then
                    doPlayerSendTextMessage(cid, 27, "Parabens! Seu "..getPokeName(itemEx.uid).." evoluiu para "..evo[monster][1].."!")
                    local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
                    doSendMagicEffect(getThingPos(itemEx.uid), 18)
                    doRemoveCreature(itemEx.uid)
                    doPlayerRemoveItem(cid, item.itemid, evo[monster][2]-1)
                    doRemoveItem(item.uid, 1)
                    doSummonMonster(cid,evo[monster][1])
                    local pokeball = getPlayerSlotItem(cid, 8)
                    doItemSetAttribute(pokeball.uid, "poke", evo[monster][1])
                    doItemSetAttribute(pokeball.uid, "level", pokes[evo[monster][1]].level)
                    doItemSetAttribute(ball, "hp", 1)
                    doItemSetAttribute(ball, "happy", 110)
                    local pk = getCreatureSummons(cid)[1]
                    local getShinyPokeballs = balls[getPlayerSlotItem(cid, 8).itemid]
                    doTransformItem(getPlayerSlotItem(cid, 8).uid, getShinyPokeballs.newBall)
                    adjustStatus(pk, pokeball.uid, true, false, true)
                    return TRUE
                 else
                    return doPlayerSendTextMessage(cid, 27, "Voce precisa de pelo menos ".. evo[monster][2] .." stones para faze-lo vira shiny!")
                 end
          end
end
return FALSE
end

up


up

Link para o post
Compartilhar em outros sites

Posta o script da sua Shiny Stone.

Já está no tópico 

local evo = {
                          
["Charizard"] = {"Shiny Charizard", 1},
}
local balls = {
[2394] = {newBall = 2394},
[2391] = {newBall = 2391},
[2393] = {newBall = 2393},
[2392] = {newBall = 2392},
[12617] = {newBall = 12617},
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
          local monster = getCreatureName(itemEx.uid)
          if evo[monster] then  
                 if getPlayerItemCount(cid, item.itemid) >= evo[monster][2] then
                    doPlayerSendTextMessage(cid, 27, "Parabens! Seu "..getPokeName(itemEx.uid).." evoluiu para "..evo[monster][1].."!")
                    local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
                    doSendMagicEffect(getThingPos(itemEx.uid), 18)
                    doRemoveCreature(itemEx.uid)
                    doPlayerRemoveItem(cid, item.itemid, evo[monster][2]-1)
                    doRemoveItem(item.uid, 1)
                    doSummonMonster(cid,evo[monster][1])
                    local pokeball = getPlayerSlotItem(cid, 8)
                    doItemSetAttribute(pokeball.uid, "poke", evo[monster][1])
                    doItemSetAttribute(pokeball.uid, "level", pokes[evo[monster][1]].level)
                    doItemSetAttribute(ball, "hp", 1)
                    doItemSetAttribute(ball, "happy", 110)
                    local pk = getCreatureSummons(cid)[1]
                    local getShinyPokeballs = balls[getPlayerSlotItem(cid, 8).itemid]
                    doTransformItem(getPlayerSlotItem(cid, 8).uid, getShinyPokeballs.newBall)
                    adjustStatus(pk, pokeball.uid, true, false, true)
                    return TRUE
                 else
                    return doPlayerSendTextMessage(cid, 27, "Voce precisa de pelo menos ".. evo[monster][2] .." stones para faze-lo vira shiny!")
                 end
          end
end
return FALSE

end
Link para o post
Compartilhar em outros sites

Me fala quais são os itens desses id's 

local balls = {

[2394] = {newBall = 2394},
[2391] = {newBall = 2391},
[2393] = {newBall = 2393},
[2392] = {newBall = 2392},
[12617] = {newBall = 12617},

vou tentar te ajudar se não conseguir pego o script de outro servidor.

Editado por diarmaint (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Bom amigo . Tinha alguns errinhos, mas acho que já consertei .

Testa ai e me fala.

 

local evo = {
                          
["Charizard"] = {"Shiny Charizard", 1},
}
local balls = {
[2394] = {newBall = 2394},
[2391] = {newBall = 2391},
[2393] = {newBall = 2393},
[2392] = {newBall = 2392},
[12617] = {newBall = 12617},
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
          local monster = getCreatureName(itemEx.uid)
          if evo[monster] then  
                 if getPlayerItemCount(cid, item.itemid) >= evo[monster][2] then
                    doPlayerSendTextMessage(cid, 27, "Parabens! Seu "..getPokeName(itemEx.uid).." evoluiu para "..evo[monster][1].."!")
                    local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
                    doSendMagicEffect(getThingPos(itemEx.uid), 18)
                    doRemoveCreature(itemEx.uid)
                    doPlayerRemoveItem(cid, item.itemid, evo[monster][2]-1)
                    doRemoveItem(item.uid, 1)
                    doSummonMonster(cid,evo[monster][1])
                    local pokeball = getPlayerSlotItem(cid, 8)
                    doItemSetAttribute(pokeball.uid, "poke", evo[monster][1])
                    doItemSetAttribute(pokeball.uid, "level", pokes[evo[monster][1]].level)
                    doItemSetAttribute(pokeball.uid, "hp", 1)
                    doItemSetAttribute(pokeball.uid, "happy", 110)
                    local pk = getCreatureSummons(cid)[1]
                    doTransformItem(pokeball.uid, balls[pokeball.itemid].newBall)
                    adjustStatus(pk, pokeball.uid, true, false, true)
                    return TRUE
                 else
                    return doPlayerSendTextMessage(cid, 27, "Voce precisa de pelo menos ".. evo[monster][2] .." stones para faze-lo vira shiny!")
                 end
          end
end
return FALSE
end

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

Tony Araújo  ;D 

 

Link para o post
Compartilhar em outros sites

 

Bom amigo . Tinha alguns errinhos, mas acho que já consertei .

Testa ai e me fala.

 

local evo = {
                          
["Charizard"] = {"Shiny Charizard", 1},
}
local balls = {
[2394] = {newBall = 2394},
[2391] = {newBall = 2391},
[2393] = {newBall = 2393},
[2392] = {newBall = 2392},
[12617] = {newBall = 12617},
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
          local monster = getCreatureName(itemEx.uid)
          if evo[monster] then  
                 if getPlayerItemCount(cid, item.itemid) >= evo[monster][2] then
                    doPlayerSendTextMessage(cid, 27, "Parabens! Seu "..getPokeName(itemEx.uid).." evoluiu para "..evo[monster][1].."!")
                    local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
                    doSendMagicEffect(getThingPos(itemEx.uid), 18)
                    doRemoveCreature(itemEx.uid)
                    doPlayerRemoveItem(cid, item.itemid, evo[monster][2]-1)
                    doRemoveItem(item.uid, 1)
                    doSummonMonster(cid,evo[monster][1])
                    local pokeball = getPlayerSlotItem(cid, 8)
                    doItemSetAttribute(pokeball.uid, "poke", evo[monster][1])
                    doItemSetAttribute(pokeball.uid, "level", pokes[evo[monster][1]].level)
                    doItemSetAttribute(pokeball.uid, "hp", 1)
                    doItemSetAttribute(pokeball.uid, "happy", 110)
                    local pk = getCreatureSummons(cid)[1]
                    doTransformItem(pokeball.uid, balls[pokeball.itemid].newBall)
                    adjustStatus(pk, pokeball.uid, true, false, true)
                    return TRUE
                 else
                    return doPlayerSendTextMessage(cid, 27, "Voce precisa de pelo menos ".. evo[monster][2] .." stones para faze-lo vira shiny!")
                 end
          end
end
return FALSE
end

 

Obrigado por tá tentado ajuda mais deu esse erro

[15/08/2014 09:05:30] [Error - Action Interface] 
[15/08/2014 09:05:30] data/actions/scripts/Shiny stone.lua:onUse
[15/08/2014 09:05:30] Description: 
[15/08/2014 09:05:30] data/actions/scripts/Shiny stone.lua:31: attempt to index field '?' (a nil value)
[15/08/2014 09:05:30] stack traceback:
[15/08/2014 09:05:30]  data/actions/scripts/Shiny stone.lua:31: in function <data/actions/scripts/Shiny stone.lua:13>

Me fala quais são os itens desses id's 

local balls = {

[2394] = {newBall = 2394},

[2391] = {newBall = 2391},

[2393] = {newBall = 2393},

[2392] = {newBall = 2392},

[12617] = {newBall = 12617},

vou tentar te ajudar se não conseguir pego o script de outro servidor.

Não precisa mexer são as balls do servidor

Link para o post
Compartilhar em outros sites
  • Solução

Teste assim agora.

 

local evo = {
["Charizard"] = {"Shiny Charizard", 1},
}
local balls = {
[2394] = {newBall = 2394},
[2391] = {newBall = 2391},
[2393] = {newBall = 2393},
[2392] = {newBall = 2392},
[12617] = {newBall = 12617},
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pokeball = getPlayerSlotItem(cid, 8)
 
if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
local monster = getCreatureName(itemEx.uid)
 
if not balls[pokeball.itemid] then
 
doPlayerSendCancel(cid, "Seu pokémon está em uma pokebola inválida.")
return true
end
 
if evo[monster] then
if getPlayerItemCount(cid, item.itemid) >= evo[monster][2] then
 
doPlayerSendTextMessage(cid, 27, "Parabens! Seu "..getPokeName(itemEx.uid).." evoluiu para "..evo[monster][1].."!")
local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
doSendMagicEffect(getThingPos(itemEx.uid), 18)
doRemoveCreature(itemEx.uid)
doPlayerRemoveItem(cid, item.itemid, evo[monster][2]-1)
doRemoveItem(item.uid, 1)
doSummonMonster(cid,evo[monster][1])
doItemSetAttribute(pokeball.uid, "poke", evo[monster][1])
doItemSetAttribute(pokeball.uid, "level", pokes[evo[monster][1]].level)
doItemSetAttribute(pokeball.uid, "hp", 1)
doItemSetAttribute(pokeball.uid, "happy", 110)
local pk = getCreatureSummons(cid)[1]
doTransformItem(pokeball.uid, balls[pokeball.itemid].newBall)
adjustStatus(pk, pokeball.uid, true, false, true)
return TRUE
else
 
return doPlayerSendTextMessage(cid, 27, "Voce precisa de pelo menos ".. evo[monster][2] .." stones para faze-lo vira shiny!")
end
end
end
return false
end

 
OBS: O Site tirou a identação do código.

Tony Araújo  ;D 

 

Link para o post
Compartilhar em outros sites
OBS: O Site tirou a identação do código.

só Postar como "code" 

 

irei testar aqui e jájá edito

 

edit, quando eu vou usar a stone diz isso ai 

Seu pokémon está em uma pokebola inválida.
Editado por TopllDanStar (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

é. exatamente ...

 

O ID , da pokebola que seu pokémon está dentro, não está configurada na tabela de pokebolas do script.

 

[Ball Atual (Normal)] = {newBall = newBallID (Shiny)},

Tony Araújo  ;D 

 

Link para o post
Compartilhar em outros sites

 

é. exatamente ...

 

O ID , da pokebola que seu pokémon está dentro, não está configurada na tabela de pokebolas do script.

[Ball Atual (Normal)] = {newBall = newBallID (Shiny)},

Já Fiz isso mais continua porque? 

Link para o post
Compartilhar em outros sites

Bom ... eu coloquei esse erro, justamente para que se ele não esteja configurado.

 

Lembrando: Você precisa por a pokebola, quando ela estiver sendo usada.

E a NewBall também.

Tony Araújo  ;D 

 

Link para o post
Compartilhar em outros sites

Era só olhar o ID, com o personagem com acesso 6 (ADM)

 

local evo = {
["Charizard"] = {"Shiny Charizard", 1},
}
 
local balls = {
[11827] = {newBall = 11738}, -- PokeBall
[11833] = {newBall = 11741}, -- GreatBall
[11836] = {newBall = 11744}, -- SuperBall
[11830] = {newBall = 11747}, -- UltraBall
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pokeball = getPlayerSlotItem(cid, 8)
 
if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
local monster = getCreatureName(itemEx.uid)
 
if not balls[pokeball.itemid] then
 
doPlayerSendCancel(cid, "Seu pokémon está em uma pokebola inválida.")
return true
end
 
if evo[monster] then
if getPlayerItemCount(cid, item.itemid) >= evo[monster][2] then
 
doPlayerSendTextMessage(cid, 27, "Parabens! Seu "..getPokeName(itemEx.uid).." evoluiu para "..evo[monster][1].."!")
local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
doSendMagicEffect(getThingPos(itemEx.uid), 18)
doRemoveCreature(itemEx.uid)
doPlayerRemoveItem(cid, item.itemid, evo[monster][2]-1)
doRemoveItem(item.uid, 1)
doSummonMonster(cid,evo[monster][1])
doItemSetAttribute(pokeball.uid, "poke", evo[monster][1])
doItemSetAttribute(pokeball.uid, "level", pokes[evo[monster][1]].level)
doItemSetAttribute(pokeball.uid, "hp", 1)
doItemSetAttribute(pokeball.uid, "happy", 110)
local pk = getCreatureSummons(cid)[1]
doTransformItem(pokeball.uid, balls[pokeball.itemid].newBall)
adjustStatus(pk, pokeball.uid, true, false, true)
return TRUE
else
 
return doPlayerSendTextMessage(cid, 27, "Voce precisa de pelo menos ".. evo[monster][2] .." stones para faze-lo vira shiny!")
end
end
end
return false
end

Tony Araújo  ;D 

 

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo