Ir para conteúdo

[Encerrado] erro no opcode


Aberos

Posts Recomendados

galera to tentado usar opcode em um script mas ta dando esse erro

 

 


[18/12/2013 22:55:03] [Error - MoveEvents Interface]
[18/12/2013 22:55:03] data/movements/scripts/portrait.lua:onEquip
[18/12/2013 22:55:03] Description:
[18/12/2013 22:55:03] (luaGetCreatureHealth) Creature not found
script que eu to tentando usar opcode

local fotos = {
["Bulbasaur"] = {fotopoke = 2377},
["Ivysaur"] = {fotopoke = 2378},
["Venusaur"] = {fotopoke = 2379},
["Charmander"] = {fotopoke = 2380},
["Charmeleon"] = {fotopoke = 2381},
["Charizard"] = {fotopoke = 2382},
["Squirtle"] = {fotopoke = 2383},
["Wartortle"] = {fotopoke = 2384},
["Blastoise"] = {fotopoke = 2385},
["Caterpie"] = {fotopoke = 2386},
["Metapod"] = {fotopoke = 2387},
["Butterfree"] = {fotopoke = 2388},
["Weedle"] = {fotopoke = 2389},
["Kakuna"] = {fotopoke = 2390},
["Beedrill"] = {fotopoke = 2391},
["Pidgey"] = {fotopoke = 2392},
["Pidgeotto"] = {fotopoke = 2393},
["Pidgeot"] = {fotopoke = 2394},
["Rattata"] = {fotopoke = 2395},
["Raticate"] = {fotopoke = 2396},
["Spearow"] = {fotopoke = 2397},
["Fearow"] = {fotopoke = 2398},
["Ekans"] = {fotopoke = 2399},
["Arbok"] = {fotopoke = 2400},
["Pikachu"] = {fotopoke = 2401},
["Raichu"] = {fotopoke = 2402},
["Sandshrew"] = {fotopoke = 2403},
["Sandslash"] = {fotopoke = 2404},
["nidoranfe"] = {fotopoke = 2405},
["Nidorina"] = {fotopoke = 2406},
["Nidoqueen"] = {fotopoke = 2407},
["nidoranma"] = {fotopoke = 2408},
["Nidorino"] = {fotopoke = 2409},
["Nidoking"] = {fotopoke = 2410},
["Clefairy"] = {fotopoke = 2411},
["Clefable"] = {fotopoke = 2412},
["Vulpix"] = {fotopoke = 2413},
["Ninetales"] = {fotopoke = 2414},
["Jigglypuff"] = {fotopoke = 2415},
["Wigglytuff"] = {fotopoke = 2416},
["Zubat"] = {fotopoke = 2417},
["Golbat"] = {fotopoke = 2418},
["Oddish"] = {fotopoke = 2419},
["Gloom"] = {fotopoke = 2420},
["Vileplume"] = {fotopoke = 2421},
["Paras"] = {fotopoke = 2422},
["Parasect"] = {fotopoke = 2423},
["Venonat"] = {fotopoke = 2424},
["Venomoth"] = {fotopoke = 2425},
["Diglett"] = {fotopoke = 2426},
["Dugtrio"] = {fotopoke = 2427},
["Meowth"] = {fotopoke = 2428},
["Persian"] = {fotopoke = 2429},
["Psyduck"] = {fotopoke = 2430},
["Golduck"] = {fotopoke = 2431},
["Mankey"] = {fotopoke = 2432},
["Primeape"] = {fotopoke = 2433},
["Growlithe"] = {fotopoke = 2434},
["Arcanine"] = {fotopoke = 2435},
["Poliwag"] = {fotopoke = 2436},
["Poliwhirl"] = {fotopoke = 2437},
["Poliwrath"] = {fotopoke = 2438},
["Abra"] = {fotopoke = 2439},
["Kadabra"] = {fotopoke = 2440},
["Alakazam"] = {fotopoke = 2441},
["Machop"] = {fotopoke = 2442},
["Machoke"] = {fotopoke = 2443},
["Machamp"] = {fotopoke = 2444},
["Bellsprout"] = {fotopoke = 2445},
["Weepinbell"] = {fotopoke = 2446},
["Victreebel"] = {fotopoke = 2447},
["Tentacool"] = {fotopoke = 2448},
["Tentacruel"] = {fotopoke = 2449},
["Geodude"] = {fotopoke = 2450},
["Graveler"] = {fotopoke = 2451},
["Golem"] = {fotopoke = 2452},
["Ponyta"] = {fotopoke = 2453},
["Rapidash"] = {fotopoke = 2454},
["Slowpoke"] = {fotopoke = 2455},
["Slowbro"] = {fotopoke = 2456},
["Magnemite"] = {fotopoke = 2457},
["Magneton"] = {fotopoke = 2458},
["Farfetchd"] = {fotopoke = 2459},
["Doduo"] = {fotopoke = 2460},
["Dodrio"] = {fotopoke = 2461},
["Seel"] = {fotopoke = 2462},
["Dewgong"] = {fotopoke = 2463},
["Grimer"] = {fotopoke = 2464},
["Muk"] = {fotopoke = 2465},
["Shellder"] = {fotopoke = 2466},
["Cloyster"] = {fotopoke = 2467},
["Gastly"] = {fotopoke = 2468},
["Haunter"] = {fotopoke = 2469},
["Gengar"] = {fotopoke = 2470},
["Onix"] = {fotopoke = 2471},
["Crystal Onix"] = {fotopoke = 11389},
["bike"] = {fotopoke = 11389},
["Drowzee"] = {fotopoke = 2472},
["Hypno"] = {fotopoke = 2473},
["Krabby"] = {fotopoke = 2474},
["Kingler"] = {fotopoke = 2475},
["Voltorb"] = {fotopoke = 2476},
["Electrode"] = {fotopoke = 2477},
["Exeggcute"] = {fotopoke = 2478},
["Exeggutor"] = {fotopoke = 2479},
["Cubone"] = {fotopoke = 2480},
["Marowak"] = {fotopoke = 2481},
["Hitmonlee"] = {fotopoke = 2482},
["Hitmonchan"] = {fotopoke = 2483},
["Lickitung"] = {fotopoke = 2484},
["Koffing"] = {fotopoke = 2485},
["Weezing"] = {fotopoke = 2486},
["Rhyhorn"] = {fotopoke = 2487},
["Rhydon"] = {fotopoke = 2488},
["Chansey"] = {fotopoke = 2489},
["Tangela"] = {fotopoke = 2490},
["Shiny Tangela"] = {fotopoke = 2490},
["Kangaskhan"] = {fotopoke = 2491},
["Horsea"] = {fotopoke = 2492},
["Seadra"] = {fotopoke = 2493},
["Goldeen"] = {fotopoke = 2494},
["Seaking"] = {fotopoke = 2495},
["Staryu"] = {fotopoke = 2496},
["Starmie"] = {fotopoke = 2497},
["MrMime"] = {fotopoke = 2498},
["Scyther"] = {fotopoke = 2499},
["Jynx"] = {fotopoke = 2500},
["Electabuzz"] = {fotopoke = 2501},
["Magmar"] = {fotopoke = 2502},
["Pinsir"] = {fotopoke = 2503},
["Tauros"] = {fotopoke = 2504},
["Magikarp"] = {fotopoke = 2505},
["Mini Magikarp"] = {fotopoke = 2505},
["Medio Magikarp"] = {fotopoke = 2505},
["Big Magikarp"] = {fotopoke = 2505},
["Gyarados"] = {fotopoke = 2506},
["Mini Gyarados"] = {fotopoke = 2506},
["Lapras"] = {fotopoke = 2507},
["Ditto"] = {fotopoke = 2508},
["Eevee"] = {fotopoke = 2509},
["Vaporeon"] = {fotopoke = 2510},
["Jolteon"] = {fotopoke = 2511},
["Flareon"] = {fotopoke = 2512},
["Porygon"] = {fotopoke = 2513},
["Omanyte"] = {fotopoke = 2514},
["Omastar"] = {fotopoke = 2515},
["Kabuto"] = {fotopoke = 2516},
["Kabutops"] = {fotopoke = 2517},
["Aerodactyl"] = {fotopoke = 2518},
["Snorlax"] = {fotopoke = 2519},
["Articuno"] = {fotopoke = 2520},
["Zapdos"] = {fotopoke = 2521},
["Moltres"] = {fotopoke = 2522},
["Dratini"] = {fotopoke = 2523},
["Dragonair"] = {fotopoke = 2524},
["Dragonite"] = {fotopoke = 2525},
["Mewtwo"] = {fotopoke = 2526},
["Mew"] = {fotopoke = 2527},
-------------------Shiny-------------------
["Elder Charizard"] = {fotopoke = 2528},
["Shiny Magikarp"] = {fotopoke = 102},
["Shiny Big Magikarp"] = {fotopoke = 102},
["Shiny Rattata"] = {fotopoke = 107},
["Shiny Oddish"] = {fotopoke = 111},
["Shiny Zubat"] = {fotopoke = 112},
["Shiny Golbat"] = {fotopoke = 12142},
["Shiny Paras"] = {fotopoke = 113},
["Dark Abra"] = {fotopoke = 145},
["Shiny Arcanine"] = {fotopoke = 146},
["Shiny Venomoth"] = {fotopoke = 147},
["Shiny Raichu"] = {fotopoke = 148},
["Elite Hitmonchan"] = {fotopoke = 149},
["Elite Hitmonlee"] = {fotopoke = 150},
["Shiny Voltorb"] = {fotopoke = 151},
["Shiny Horsea"] = {fotopoke = 152},
["Shiny Gengar"] = {fotopoke = 2175},
["Shiny Tentacruel"] = {fotopoke = 153},
["Shiny Growlithe"] = {fotopoke = 154},
["Shiny Venonat"] = {fotopoke = 155},
["Shiny Blastoise"] = {fotopoke = 156},
["Shiny Raticate"] = {fotopoke = 157},
["Shiny Electrode"] = {fotopoke = 158},
["Shiny Dratini"] = {fotopoke = 159},
["Shiny Electabuzz"] = {fotopoke = 160},
["Shiny Kingler"] = {fotopoke = 161},
["Shiny Muk"] = {fotopoke = 162},
["Shiny Tentacool"] = {fotopoke = 163},
["Shiny Seadra"] = {fotopoke = 164},
["Shiny Parasect"] = {fotopoke = 165},
["Shiny Beedrill"] = {fotopoke = 166},
["Red Gyarados"] = {fotopoke = 167},
["Shiny Scyther"] = {fotopoke = 168},
["Shiny Jynx"] = {fotopoke = 169},
["Shiny Krabby"] = {fotopoke = 170},
["Shiny Grimer"] = {fotopoke = 171},
["Elite Farfetchd"] = {fotopoke = 172},
["Shiny Butterfree"] = {fotopoke = 173},
["Shiny Venusaur"] = {fotopoke = 174},
["Big Snorlax"] = {fotopoke = 12203},
["Shiny Alakazam"] = {fotopoke = 12204},
["Shiny Cubone"] = {fotopoke = 12205},
["Shiny Dodrio"] = {fotopoke = 12206},
["Shiny Dragonair"] = {fotopoke = 12207},
["Shiny Fearow"] = {fotopoke = 12208},
["Shiny Flareon"] = {fotopoke = 12226},
["Shiny Golem"] = {fotopoke = 12209},
["Shiny Hypno"] = {fotopoke = 12210},
["Shiny Jolteon"] = {fotopoke = 12211},
["Shiny Machamp"] = {fotopoke = 12212},
["Shiny Magneton"] = {fotopoke = 12214},
["Shiny Marowak"] = {fotopoke = 12215},
["Shiny MrMime"] = {fotopoke = 12216},
["Shiny Nidoking"] = {fotopoke = 12217},
["Shiny Ninetales"] = {fotopoke = 12218},
["Shiny Pidgeot"] = {fotopoke = 12219},
["Shiny Pinsir"] = {fotopoke = 12220},
["Shiny Rhydon"] = {fotopoke = 12221},
["Shiny Tauros"] = {fotopoke = 12223},
["Shiny Vaporeon"] = {fotopoke = 12224},
["Shiny Vileplume"] = {fotopoke = 12225},
["Shiny Tangela"] = {fotopoke = 12222},
["Shiny Magmar"] = {fotopoke = 12213},
-------------------Johto-------------------
["Aipom"] = {fotopoke = 11371},
["Ampharos"] = {fotopoke = 11517},
["Ariados"] = {fotopoke = 11518},
["Azumarill"] = {fotopoke = 11519},
["Bayleef"] = {fotopoke = 11520},
["Bellossom"] = {fotopoke = 11521},
["Blissey"] = {fotopoke = 11522},
["Celebi"] = {fotopoke = 11523},
["Chikorita"] = {fotopoke = 11524},
["Chinchou"] = {fotopoke = 11525},
["Cleffa"] = {fotopoke = 11526},
["Corsola"] = {fotopoke = 11527},
["Crobat"] = {fotopoke = 11528},
["Croconaw"] = {fotopoke = 11529},
["Cyndaquil"] = {fotopoke = 11530},
["Delibird"] = {fotopoke = 11532},
["Donphan"] = {fotopoke = 11533},
["Dunsparce"] = {fotopoke = 11534},
["Elekid"] = {fotopoke = 11535},
["Entei"] = {fotopoke = 11536},
["Espeon"] = {fotopoke = 11537},
["Feraligatr"] = {fotopoke = 11538},
["Flaaffy"] = {fotopoke = 11539},
["Forretress"] ={fotopoke = 11540},
["Furret"] = {fotopoke = 11541},
["Gallade"] ={fotopoke = 11631},
["Girafarig"] ={fotopoke = 11542},
["Gligar"] = {fotopoke = 11543},
["Granbull"] = {fotopoke = 11544},
["Heracross"] = {fotopoke = 11545},
["Hitmontop"] = {fotopoke = 11546},
["Ho oh"] = {fotopoke = 11547},
["Hoothoot"] = {fotopoke = 11548},
["Hoppip"] = {fotopoke = 11549},
["Houndoom"] = {fotopoke = 11550},
["Houndour"] = {fotopoke = 11551},
["Igglypuff"] = {fotopoke = 11552},
["Jumpluff"] = {fotopoke = 11553},
["Kingdra"] = {fotopoke = 11554},
["Lanturn"] = {fotopoke = 11555},
["Larvitar"] = {fotopoke = 11556},
["Ledian"] = {fotopoke = 11557},
["Ledyba"] = {fotopoke = 11558},
["Lugia"] = {fotopoke = 11559},
["Magby"] = {fotopoke = 11560},
["Magcargo"] = {fotopoke = 11561},
["Mantine"] = {fotopoke = 11562},
["Mareep"] = {fotopoke = 11563},
["Marill"] = {fotopoke = 11564},
["Meganium"] ={fotopoke = 11565},
["Miltank"] ={fotopoke = 11566},
["Misdreavus"] = {fotopoke = 11567},
["Murkrow"] = {fotopoke = 11568},
["Natu"] = {fotopoke = 11569},
["Noctowl"] = {fotopoke = 11570},
["Octillery"] ={fotopoke = 11571},
["Phanpy"] = {fotopoke = 11572},
["Pichu"] = {fotopoke = 11573},
["Piloswine"] ={fotopoke = 11574},
["Pineco"] = {fotopoke = 11575},
["Politoed"] ={fotopoke = 11576},
["porygon2"] ={fotopoke = 11577},
["Pupitar"] = {fotopoke = 11578},
["Quagsire"] ={fotopoke = 11579},
["Quilava"] ={fotopoke = 11580},
["Qwilfish"] ={fotopoke = 11581},
["Raikou"] ={fotopoke = 11582},
["Remoraid"] = {fotopoke = 11583},
["Scizor"] = {fotopoke = 11584},
["Shuckle"] ={fotopoke = 11586},
["Skarmory"] ={fotopoke = 11587},
["Skiploom"] ={fotopoke = 11588},
["Slowking"] = {fotopoke = 11589},
["Slugma"] ={fotopoke = 11590},
["Smeargle Virgem"] = {fotopoke = 11591},
["Smeargle Tm 1"] = {fotopoke = 11591},
["Smeargle Tm 2"] = {fotopoke = 11591},
["Smeargle Tm 3"] = {fotopoke = 11591},
["Smeargle Tm 4"] = {fotopoke = 11591},
["Smeargle Tm 5"] = {fotopoke = 11591},
["Smeargle Tm 6"] = {fotopoke = 11591},
["Smeargle Tm 7"] = {fotopoke = 11591},
["Smoochum"] = {fotopoke = 11592},
["Sneasel"] = {fotopoke = 11593},
["Sentret"] = {fotopoke = 11585},
["Snubbull"] = {fotopoke = 11594},
["Spinarak"] ={fotopoke = 11595},
["Stantler"] = {fotopoke = 11596},
["Steelix"] = {fotopoke = 11597},
["Sudowoodo"] ={fotopoke = 11598},
["Suicune"] = {fotopoke = 11599},
["Sunflora"] = {fotopoke = 11600},
["Sunkern"] = {fotopoke = 11601},
["Swinub"] ={fotopoke = 11602},
["Teddiursa"] ={fotopoke = 11603},
["Togepi"] = {fotopoke = 11604},
["Togetic"] ={fotopoke = 11605},
["Totodile"] ={fotopoke = 11606},
["Typhlosion"] ={fotopoke = 11607},
["Tyranitar"] = {fotopoke = 11608},
["Tyrogue"] = {fotopoke = 11609},
["Umbreon"] ={fotopoke = 11610},
["Unown a"] = {fotopoke = 11611},
["Unown b"] = {fotopoke = 11966},
["Unown c"] = {fotopoke = 11967},
["Unown d"] = {fotopoke = 11968},
["Unown e"] = {fotopoke = 11969},
["Unown f"] = {fotopoke = 11970},
["Unown g"] = {fotopoke = 11971},
["Unown h"] ={fotopoke = 11972},
["Unown i"] = {fotopoke = 11973},
["Unown j"] = {fotopoke = 11974},
["Unown k"] = {fotopoke = 11975},
["Unown l"] = {fotopoke = 11976},
["Unown m"] ={fotopoke = 11977},
["Unown n"] = {fotopoke = 11978},
["Unown o"] ={fotopoke = 11979},
["Unown p"] = {fotopoke = 11980},
["Unown q"] ={fotopoke = 11981},
["Unown r"] = {fotopoke = 11982},
["Unown s"] ={fotopoke = 11983},
["Unown t"] = {fotopoke = 11984},
["Unown u"] = {fotopoke = 11985},
["Unown v"] = {fotopoke = 11986},
["Unown w"] = {fotopoke = 11987},
["Unown x"] ={fotopoke = 11990},
["Unown y"] = {fotopoke = 11988},
["Unown z"] = {fotopoke = 11989},
["Ursaring"] = {fotopoke = 11612},
["Wobbuffet"] = {fotopoke = 11613},
["Wooper"] = {fotopoke = 11614},
["Xatu"] = {fotopoke = 11615},
["Yanma"] = {fotopoke = 11616},
["Giratina"] = {fotopoke = 11632},
["Palkia"] = {fotopoke = 11634},
["Rayquaza"] = {fotopoke = 11636},
["Primal Dialga"] = {fotopoke = 11639},
["Dialga"] = {fotopoke = 11641},
}
function onEquip (cid, item, slot)
for i,x in pairs(fotos) do
if i == getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1) then
doTransformItem(getPlayerSlotItem(cid, 7).uid, fotos.fotopoke)
doSendPlayerExtendedOpcode(cid, 51, getCreatureHealth(getCreatureSummons(cid)))
return true
end
end
end

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

A função getCreatureSummons(cid) não retorna um uid, mas uma lista de summons.

 

 

Uma dica de otimização:

 

Ao invés de:

local fotos = {
["Bulbasaur"] = {fotopoke = 2377},
["Ivysaur"] = {fotopoke = 2378},
["Venusaur"] = {fotopoke = 2379},
.
.
.
Faz:
local fotos = {
["Bulbasaur"] = 2377,
["Ivysaur"] = 2378,
["Venusaur"] = 2379,
.
.
.

 

E acessa somente usando fotos

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

No lugar de

 

doSendPlayerExtendedOpcode(cid, 51, getCreatureHealth(getCreatureSummons(cid)))

Tenta assim:

 

if #getCreatureSummons(cid) >= 1 then
doSendPlayerExtendedOpcode(cid, 51, getCreatureHealth(getCreatureSummons(cid)[1]))
end
Link para o comentário
Compartilhar em outros sites

no caso o poke estaria na ball,então tem que pegar pelo atributo de hp da ball.

 

fotos[getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1)]

 

no lugar daquele loop gigante.

Link para o comentário
Compartilhar em outros sites

  • 4 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...