Postado Maio 12, 2014 11 anos Olá Galera do TK! Tenho um server de poketibia (PDA) e peguei um sistema de addon do Servidor Centurion.. Editei tudo, mas quando vou usar da um erro no server e nao dá para o pokemon ficar com o addon!! Peço para que alguem me ajude a consertar este erro. Mostrar conteúdo oculto o Erro que aparece na distro: [12/05/2014 12:37:13] [Error - Action Interface] [12/05/2014 12:37:13] data/actions/scripts/Addons.lua:onUse [12/05/2014 12:37:13] Description: [12/05/2014 12:37:13] data/actions/scripts/Addons.lua:32: attempt to compare nil with number [12/05/2014 12:37:13] stack traceback: [12/05/2014 12:37:13] data/actions/scripts/Addons.lua:32: in function <data/actions/scripts/Addons.lua:1> ---Script Addons.lua.. function onUse(cid, item, fromPosition, itemEx, toPosition) local addons = { [12722] = {pokemon= "Tyranitar" , looktype = 1566, count = 1}, [12722] = {pokemon= "Shiny Tyranitar" , looktype = 1561, count = 1}, [2323] = {pokemon= "Tyranitar" , looktype = 1557, count = 1}, [2323] = {pokemon= "Shiny Tyranitar" , looktype = 1560, count = 1}, [2662] = {pokemon= "Shiny Alakazam" , looktype = 1562, count = 1}, [12723] = {pokemon= "Shiny Gengar" , looktype = 1558, 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 if getItemAttribute(pb,"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 Obrigado. Ate a proxima
Postado Maio 12, 2014 11 anos function onUse(cid, item, fromPosition, itemEx, toPosition) local addons = { [12722] = {pokemon= "Tyranitar" , looktype = 1566, count = 1}, [12722] = {pokemon= "Shiny Tyranitar" , looktype = 1561, count = 1}, [2323] = {pokemon= "Tyranitar" , looktype = 1557, count = 1}, [2323] = {pokemon= "Shiny Tyranitar" , looktype = 1560, count = 1}, [2662] = {pokemon= "Shiny Alakazam" , looktype = 1562, count = 1}, [12723] = {pokemon= "Shiny Gengar" , looktype = 1558, 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 if(getItemAttribute(pb,"addon") < 1) then doRemoveItem(item.uid, count) 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
Postado Maio 13, 2014 11 anos Autor Cara, ainda ta dando erro ajuda ai [13/05/2014 11:01:22] [Error - Action Interface] [13/05/2014 11:01:22] data/actions/scripts/Addons.lua:onUse [13/05/2014 11:01:22] Description: [13/05/2014 11:01:22] data/actions/scripts/Addons.lua:33: attempt to compare nil with number [13/05/2014 11:01:22] stack traceback: [13/05/2014 11:01:22] data/actions/scripts/Addons.lua:33: in function <data/actions/scripts/Addons.lua:1>
Postado Maio 13, 2014 11 anos Tenta isso. Mostrar conteúdo oculto function onUse(cid, item, fromPosition, itemEx, toPosition) local addons = { [12722] = {pokemon= "Tyranitar" , looktype = 1566, count = 1}, [12722] = {pokemon= "Shiny Tyranitar" , looktype = 1561, count = 1}, [2323] = {pokemon= "Tyranitar" , looktype = 1557, count = 1}, [2323] = {pokemon= "Shiny Tyranitar" , looktype = 1560, count = 1}, [2662] = {pokemon= "Shiny Alakazam" , looktype = 1562, count = 1}, [12723] = {pokemon= "Shiny Gengar" , looktype = 1558, 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, "Sorry, you don't have a "..pk.." in the slot") return false end 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 if(doRemoveItem(item.uid, count)) then doPlayerSendTextMessage(cid, 27, "Congratulations! You have performed successfully. To remove the addon says: !addons remove") doSetItemAttribute(pb,"addon", numero) else doPlayerSendCancel(cid, "You dont have cont this item for addon of your "..pk..".") end return true end return true end Viu, me faz um favor, tem como tu me passar seu goback.lua ? xD Editado Maio 13, 2014 11 anos por Lucas Weich (veja o histórico de edições)
Postado Maio 17, 2014 11 anos Autor [17/05/2014 00:23:15] [Error - LuaScriptInterface::loadFile] data/actions/scripts/Addons.lua:40: '<eof>' expected near 'end' [17/05/2014 00:23:15] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/Addons.lua) [17/05/2014 00:23:15] data/actions/scripts/Addons.lua:40: '<eof>' expected near 'end' [17/05/2014 00:23:15] Reloaded actions.
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.