Ir para conteúdo

Boost Stone Script


RodriigoRobson

Posts Recomendados

Eae Galera estou com Erro no Meu Boost Stone aki o Erro é esse:

obs: Nao é PDA

 


[17/02/2014 12:55:05] [Error - Action Interface]
[17/02/2014 12:55:05] data/actions/scripts/BStone.lua:onUse
[17/02/2014 12:55:05] Description:
[17/02/2014 12:55:05] data/actions/scripts/BStone.lua:40: attempt to compare number with nil
[17/02/2014 12:55:05] stack traceback:

 

 

Script:

 

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


--##config##--
local ball_id = {2222,2220}
local pedras = {
-- [sTONE_ID] = {pokemons que usam a stone}
--[[Fire]]
[5468] = {names = "Typhlosion,Slugma,Quilava,Magcargo,Magcarbo,Magby,Houndour,Houndoom,Ho oh,Entei,Cyndaquil,Charmander, Charizard, Charmeleon, Arcanine, Growlithe, Flareon, Magmar, Ninetales, Rapidash, Vulpix, Ponyta, Moltres, Shiny Arcanine, Elder Charizard, Shiny Growlithe" ,count = 1},
--[[Crystal]]
[5468] = {names = "Skarmory,Kingdra,Dragonite, Dragonair, Shiny Dragonair, Shiny Dratini, Dratini" ,count = 5},
--[[Enigma]]
[5468] = {names = "Xatu,Unown C,Unown D,Unown E,Unown F,Unown G,Unown H,Unown I,Unown J,Unown K,Unown L,Unown M,Unown N,Unown O,Unown P,Unown Q,Unown R,Unown S,Unown T,Unown U,Unown V,Unown W,Unown X,Unown Y,Unown Z,Unown B,Unown A,Slowking,Natu,Girafarig,Espeon,Alakazam, Shiny Alakazam, Abra, Kadabra, Hypno, Drowzee, Mr Mime, Mew, Mewtwo" ,count = 5},
--[[Venom]]
[5468] = {names = "Qwilfish,Gligar,Crobat,Nidoking, Nidoqueen, Muk, Grimer, Weezing, Koffing, Ekans, Arbok, Golbat, Zubat, Nidoranfemale, Nidoranmale, Nidorina, Nidorino, Venonat, Venomoth, Shiny Venomoth, Shiny Zubat, Shiny Golbat, Shiny Muk, Shiny Grimer, Shiny Venonat" ,count = 5},
--[[Thunder]]
[5468] = {names = "Raikou,Pichu,Mareep,Flaaffy,Elekid,Ampharos,Electabuzz, Raichu, Pikachu, Electrode, Voltorb, Jolteon, Magnetom, Magnemite, Zapdos, Shiny Electabuzz, Shiny Raichu, Shiny Voltorb, Shiny Electrode" ,count = 5},
--[[Coccon]]
[5468] = {names = "Yanma,Spinarak,Scizor,Pineco,Ledian,Ledyba,Heracross,Forretress,Dunsparce,Ariados,Scyther, Parasect, Shiny Parasect, Paras, Caterpie, Weedle, Beedrill, Butterfree, Kakuna, Metapod, Pinsir, Shiny Scyther, Shiny Beedrill, Shiny Butterfree, Shiny Paras" ,count = 5},
--[[Leaf]]
[5468] = {names = "Sunkern,Sunflora,Skiploom,Meganium,Jumpluff,Hoppip,Chikorita,Celebi,Bellossom,Bayleef,Venusaur, Bulbasaur, Ivysaur, Tangela, Exeggutor, Weepinbell, Bellsprout, Victreebel, Oddish, Vileplume, Gloom, Exeggcute, Shiny Venusaur, Shiny Oddish" ,count = 5},
--[[Water]]
[5468] = {names = "Wooper,Totodile,Suicune,Remoraid,Quagsire,Politoed,Octilery,Marill,Mantine,Lugia,Lanturn,Feraligatr,Croconaw,Corsola,Chinchou,Azumarill,Magikarp, Blastoise, Squirtle, Wartortle, Vaporeon, Gyarados, Omastar, Omanyte, Lapras, Poliwrath, Poliwag, poliwhirl, Horsea, Seadra, Krabby, Kingler, Psyduck, Golduck, Tentacool, Tentacruel, Slowpoke, Slowbro, Goldeen, Seaking, Staryu, Starmie, Lapras, Shiny Blastoise, Shiny Seadra, Shiny Krabby, Shiny Kingler, Shiny Tentacool, Shiny Tentacruel, Shiny Horsea, Red Gyarados, Shiny Magikarp, Shiny Big Magikarp" ,count = 5},
--[[Heart]]
[5468] = {names = "Wobbuffet,Ursaring,Togetic,Togepi,Teddiursa,Stantler,Snubbull,Smeargle,Sentret,Porygon2,Noctowl,Miltank,Igglybuff,Hoothoot,Granbull,Furret,Delibird,Cleffa,Blissey, Pidgeotto, Fearow, Pidgey, Chansey, Clefable, Wiglyttuff, Kangaskhan, Porygon, Raticate, Rattata, Doduo, Dodrio, Spearow, Clefairy, Jigglypuff, Meowth, Persian, Farfetchd, Lickitung, Ditto, Eevee, Snorlax, Shiny Pidgeot, Shiny Rattata, Shiny Raticate,Elite Farfetchd,Aipom,Pidgeot" ,count = 5},
--[[Darkness]]
[5468] = {names = "Murkrow, Misdreavus, Haunter, Gengar, Gastly, Dark Abra, Shiny Gengar" ,count = 5},
--[[Punch]]
[5468] = {names = "Tyrogue,Hitmontop, Hitmonchan, Hitmonlee, Machamp, Elite Hitmonlee, Elite Hitmonchan, Mankey, Primeape, Machop, Machoke" ,count = 5},
--[[Earth]]
[5468] = {names = "Phanpy, Dophan, Diglett, Sandslash, Dugtrio, Sandsherew, Marowak, Cubone, Shiny Marowak" ,count = 5} ,
--[[Rock]]
[5468] = {names = "Tyranitar,Sudowoodo,Steelix,Shuckle, Pupitar, Larvitar, Geodude, Golem, Rhydon, Graveler, Rhyhorn, Aerodactyl, Kabutops, Kabuto, Onix, Crystal Onix" ,count = 5},
--[[ice]]
[5468] = {names = "Swinub,Sneasel,Smoochum,Piloswine,Seel, Jynx, Dewgong, Cloyster, Shellder, Articuno, Shiny Jynx" ,count = 5} ,

}
--##end config##---
boost = tonumber(boost)
if (boost >= 50) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon is already the maximum allowed boost")
end
local ball = getPlayerSlotItem(cid, CONST_SLOT_FEET) ;
if not(ball.uid > 0) then
return doPlayerSendTextMessage(cid,19,"[boost] Coloca A Ball no Slot")
end
local pokename = getItemSpecialDescription(ball.uid)
local name = getItemAttribute(ball.uid, "poke"):match("This is (.+)'s pokeball.")
if(pokename:find("\+(%d+)"))then
local boost = pokename:match("\+(%d+)")
doItemSetAttribute(ball.uid, "description", tostring(pokename:gsub(boost,((tonumber(boost)+1)))))
else
doItemSetAttribute(ball.uid, "description", "Contains a "..name.." +1.")
end
return true
end

 

Link para o comentário
Compartilhar em outros sites

Tenta:

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


--##config##--
local ball_id = {2222, 2220}
local pedras = {
-- [sTONE_ID] = {pokemons que usam a stone}
--[[Fire]]
[5468] = {names = "Typhlosion, Slugma, Quilava, Magcargo, Magcarbo, Magby, Houndour, Houndoom, Ho oh, Entei, Cyndaquil, Charmander, Charizard, Charmeleon, Arcanine, Growlithe, Flareon, Magmar, Ninetales, Rapidash, Vulpix, Ponyta, Moltres, Shiny Arcanine, Elder Charizard, Shiny Growlithe" , count = 1},
--[[Crystal]]
[5468] = {names = "Skarmory, Kingdra, Dragonite, Dragonair, Shiny Dragonair, Shiny Dratini, Dratini" , count = 5},
--[[Enigma]]
[5468] = {names = "Xatu, Unown C, Unown D, Unown E, Unown F, Unown G, Unown H, Unown I, Unown J, Unown K, Unown L, Unown M, Unown N, Unown O, Unown P, Unown Q, Unown R, Unown S, Unown T, Unown U, Unown V, Unown W, Unown X, Unown Y, Unown Z, Unown B, Unown A, Slowking, Natu, Girafarig, Espeon, Alakazam, Shiny Alakazam, Abra, Kadabra, Hypno, Drowzee, Mr Mime, Mew, Mewtwo" , count = 5},
--[[Venom]]
[5468] = {names = "Qwilfish, Gligar, Crobat, Nidoking, Nidoqueen, Muk, Grimer, Weezing, Koffing, Ekans, Arbok, Golbat, Zubat, Nidoranfemale, Nidoranmale, Nidorina, Nidorino, Venonat, Venomoth, Shiny Venomoth, Shiny Zubat, Shiny Golbat, Shiny Muk, Shiny Grimer, Shiny Venonat" , count = 5},
--[[Thunder]]
[5468] = {names = "Raikou, Pichu, Mareep, Flaaffy, Elekid, Ampharos, Electabuzz, Raichu, Pikachu, Electrode, Voltorb, Jolteon, Magnetom, Magnemite, Zapdos, Shiny Electabuzz, Shiny Raichu, Shiny Voltorb, Shiny Electrode" , count = 5},
--[[Coccon]]
[5468] = {names = "Yanma, Spinarak, Scizor, Pineco, Ledian, Ledyba, Heracross, Forretress, Dunsparce, Ariados, Scyther, Parasect, Shiny Parasect, Paras, Caterpie, Weedle, Beedrill, Butterfree, Kakuna, Metapod, Pinsir, Shiny Scyther, Shiny Beedrill, Shiny Butterfree, Shiny Paras" , count = 5},
--[[Leaf]]
[5468] = {names = "Sunkern, Sunflora, Skiploom, Meganium, Jumpluff, Hoppip, Chikorita, Celebi, Bellossom, Bayleef, Venusaur, Bulbasaur, Ivysaur, Tangela, Exeggutor, Weepinbell, Bellsprout, Victreebel, Oddish, Vileplume, Gloom, Exeggcute, Shiny Venusaur, Shiny Oddish" , count = 5},
--[[Water]]
[5468] = {names = "Wooper, Totodile, Suicune, Remoraid, Quagsire, Politoed, Octilery, Marill, Mantine, Lugia, Lanturn, Feraligatr, Croconaw, Corsola, Chinchou, Azumarill, Magikarp, Blastoise, Squirtle, Wartortle, Vaporeon, Gyarados, Omastar, Omanyte, Lapras, Poliwrath, Poliwag, poliwhirl, Horsea, Seadra, Krabby, Kingler, Psyduck, Golduck, Tentacool, Tentacruel, Slowpoke, Slowbro, Goldeen, Seaking, Staryu, Starmie, Lapras, Shiny Blastoise, Shiny Seadra, Shiny Krabby, Shiny Kingler, Shiny Tentacool, Shiny Tentacruel, Shiny Horsea, Red Gyarados, Shiny Magikarp, Shiny Big Magikarp" , count = 5},
--[[Heart]]
[5468] = {names = "Wobbuffet, Ursaring, Togetic, Togepi, Teddiursa, Stantler, Snubbull, Smeargle, Sentret, Porygon2, Noctowl, Miltank, Igglybuff, Hoothoot, Granbull, Furret, Delibird, Cleffa, Blissey, Pidgeotto, Fearow, Pidgey, Chansey, Clefable, Wiglyttuff, Kangaskhan, Porygon, Raticate, Rattata, Doduo, Dodrio, Spearow, Clefairy, Jigglypuff, Meowth, Persian, Farfetchd, Lickitung, Ditto, Eevee, Snorlax, Shiny Pidgeot, Shiny Rattata, Shiny Raticate, Elite Farfetchd, Aipom, Pidgeot" , count = 5},
--[[Darkness]]
[5468] = {names = "Murkrow, Misdreavus, Haunter, Gengar, Gastly, Dark Abra, Shiny Gengar" , count = 5},
--[[Punch]]
[5468] = {names = "Tyrogue, Hitmontop, Hitmonchan, Hitmonlee, Machamp, Elite Hitmonlee, Elite Hitmonchan, Mankey, Primeape, Machop, Machoke" , count = 5},
--[[Earth]]
[5468] = {names = "Phanpy, Dophan, Diglett, Sandslash, Dugtrio, Sandsherew, Marowak, Cubone, Shiny Marowak" , count = 5} ,
--[[Rock]]
[5468] = {names = "Tyranitar, Sudowoodo, Steelix, Shuckle, Pupitar, Larvitar, Geodude, Golem, Rhydon, Graveler, Rhyhorn, Aerodactyl, Kabutops, Kabuto, Onix, Crystal Onix" , count = 5},
--[[ice]]
[5468] = {names = "Swinub, Sneasel, Smoochum, Piloswine, Seel, Jynx, Dewgong, Cloyster, Shellder, Articuno, Shiny Jynx" , count = 5} ,

}
--##end config##---
boost = tonumber(boost)
if (boost >= 50) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon is already the maximum allowed boost")
end
local ball = getPlayerSlotItem(cid, CONST_SLOT_FEET) ;
if not(ball.uid > 0) then
return doPlayerSendTextMessage(cid, 19, "[boost] Coloca A Ball no Slot")
end
local pokename = getItemSpecialDescription(ball.uid)
local name = getItemAttribute(ball.uid, "poke"):match("This is (.+)'s pokeball.")
if(pokename:find("\+(%d+)"))then
local boost = pokename:match("\+(%d+)")
doItemSetAttribute(ball.uid, "description", tostring(pokename:gsub(boost, ((tonumber(boost)+1)))))
else
doItemSetAttribute(ball.uid, "description", "Contains a "..name.." +1.")
end
return true
end

Editado por FlamesAdmin
Link para o comentário
Compartilhar em outros sites

Sim eu Arrumei e pq estava com preguiça de arruma todos os pokemons na mesma tabela *-*, Porem Esta dando o mesmo Erro:

 

[17/02/2014 13:55:05] [Error - Action Interface]
[17/02/2014 13:55:05] data/actions/scripts/BStone.lua:onUse
[17/02/2014 13:55:05] Description:
[17/02/2014 13:55:05] data/actions/scripts/BStone.lua:40: attempt to compare number with nil
[17/02/2014 13:55:05] stack traceback:

 

Editado por Nextbr
Link para o comentário
Compartilhar em outros sites

Como Posso Faze-lo?

assim?

se eu Deixa > [Maior] == [igual] >= [Maior ou Igual] Nao Funfa , se eu deixa <= [Funfa] mais aparece "Your pokemon is already the maximum allowed boost"

 

 

function onUse(cid, item, frompos, item2, topos)
local ball_id = {2222, 2220}
local pedras = {
[5468] = {names = "Typhlosion, Slugma, Quilava, Magcargo, Magcarbo, Magby, Houndour, Houndoom, Ho oh, Entei, Cyndaquil, Charmander, Charizard, Charmeleon, Arcanine, Growlithe, Flareon, Magmar, Ninetales, Rapidash, Vulpix, Ponyta, Moltres, Shiny Arcanine, Elder Charizard, Shiny Growlithe,Skarmory, Kingdra, Dragonite, Dragonair, Shiny Dragonair, Shiny Dratini, Dratini,Xatu, Unown C, Unown D, Unown E, Unown F, Unown G, Unown H, Unown I, Unown J, Unown K, Unown L, Unown M, Unown N, Unown O, Unown P, Unown Q, Unown R, Unown S, Unown T, Unown U, Unown V, Unown W, Unown X, Unown Y, Unown Z, Unown B, Unown A, Slowking, Natu, Girafarig, Espeon, Alakazam, Shiny Alakazam, Abra, Kadabra, Hypno, Drowzee, Mr Mime, Mew, Mewtwo,Qwilfish, Gligar, Crobat, Nidoking, Nidoqueen, Muk, Grimer, Weezing, Koffing, Ekans, Arbok, Golbat, Zubat, Nidoranfemale, Nidoranmale, Nidorina, Nidorino, Venonat, Venomoth, Shiny Venomoth, Shiny Zubat, Shiny Golbat, Shiny Muk, Shiny Grimer, Shiny Venonat,Raikou, Pichu, Mareep, Flaaffy, Elekid, Ampharos, Electabuzz, Raichu, Pikachu, Electrode, Voltorb, Jolteon, Magnetom, Magnemite, Zapdos, Shiny Electabuzz, Shiny Raichu, Shiny Voltorb, Shiny Electrode,Yanma, Spinarak, Scizor, Pineco, Ledian, Ledyba, Heracross, Forretress, Dunsparce, Ariados, Scyther, Parasect, Shiny Parasect, Paras, Caterpie, Weedle, Beedrill, Butterfree, Kakuna, Metapod, Pinsir, Shiny Scyther, Shiny Beedrill, Shiny Butterfree, Shiny Paras,Sunkern, Sunflora, Skiploom, Meganium, Jumpluff, Hoppip, Chikorita, Celebi, Bellossom, Bayleef, Venusaur, Bulbasaur, Ivysaur, Tangela, Exeggutor, Weepinbell, Bellsprout, Victreebel, Oddish, Vileplume, Gloom, Exeggcute, Shiny Venusaur, Shiny Oddish,Wooper, Totodile, Suicune, Remoraid, Quagsire, Politoed, Octilery, Marill, Mantine, Lugia, Lanturn, Feraligatr, Croconaw, Corsola, Chinchou, Azumarill, Magikarp, Blastoise, Squirtle, Wartortle, Vaporeon, Gyarados, Omastar, Omanyte, Lapras, Poliwrath, Poliwag, poliwhirl, Horsea, Seadra, Krabby, Kingler, Psyduck, Golduck, Tentacool, Tentacruel, Slowpoke, Slowbro, Goldeen, Seaking, Staryu, Starmie, Lapras, Shiny Blastoise, Shiny Seadra, Shiny Krabby, Shiny Kingler, Shiny Tentacool, Shiny Tentacruel, Shiny Horsea, Red Gyarados, Shiny Magikarp, Shiny Big Magikarp,Wobbuffet, Ursaring, Togetic, Togepi, Teddiursa, Stantler, Snubbull, Smeargle, Sentret, Porygon2, Noctowl, Miltank, Igglybuff, Hoothoot, Granbull, Furret, Delibird, Cleffa, Blissey, Pidgeotto, Fearow, Pidgey, Chansey, Clefable, Wiglyttuff, Kangaskhan, Porygon, Raticate, Rattata, Doduo, Dodrio, Spearow, Clefairy, Jigglypuff, Meowth, Persian, Farfetchd, Lickitung, Ditto, Eevee, Snorlax, Shiny Pidgeot, Shiny Rattata, Shiny Raticate, Elite Farfetchd, Aipom, Pidgeot,Murkrow, Misdreavus, Haunter, Gengar, Gastly, Dark Abra, Shiny Gengar,Tyrogue, Hitmontop, Hitmonchan, Hitmonlee, Machamp, Elite Hitmonlee, Elite Hitmonchan, Mankey, Primeape, Machop, Machoke,Phanpy, Dophan, Diglett, Sandslash, Dugtrio, Sandsherew, Marowak, Cubone, Shiny Marowak,Tyranitar, Sudowoodo, Steelix, Shuckle, Pupitar, Larvitar, Geodude, Golem, Rhydon, Graveler, Rhyhorn, Aerodactyl, Kabutops, Kabuto, Onix, Crystal Onix,Swinub, Sneasel, Smoochum, Piloswine, Seel, Jynx, Dewgong, Cloyster, Shellder, Articuno, Shiny Jynx"} ,

}

local boost = tonumber(boost) or 0
if (boost <= 50) then
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon is already the maximum allowed boost")
end
local ball = getPlayerSlotItem(cid, CONST_SLOT_FEET) ;
if not(ball.uid > 0) then
return doPlayerSendTextMessage(cid, 19, "[boost] Coloca A Ball no Slot")
end
local pokename = getItemSpecialDescription(ball.uid)
local name = getItemAttribute(ball.uid, "poke"):match("This is (.+)'s pokeball.")
if(pokename:find("\+(%d+)"))then
local boost = pokename:match("\+(%d+)")
doItemSetAttribute(ball.uid, "description", tostring(pokename:gsub(boost, ((tonumber(boost)+1)))))
else
doItemSetAttribute(ball.uid, "description", "Contains a "..name.." +1.")
end
return true
end

 

Editado por Nextbr
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...