Ir para conteúdo

[Encerrado] Error in the TM system console


Step Records

Posts Recomendados

hello again, I warmly all have a question and a problem because I would like to introduce TM system to the server and there is a problem because the error pops up here is this. And I did everything as in the subject. TM System Tematiwo

Citar

[20/11/2018 18:07:24] [Error - Action Interface]
[20/11/2018 18:07:24] data/actions/scripts/TM.lua:onUse
[20/11/2018 18:07:24] Description:
[20/11/2018 18:07:24] data/actions/scripts/TM.lua:213: attempt to concatenate field 'tm' (a nil value)
[20/11/2018 18:07:24] stack traceback:
[20/11/2018 18:07:24]     data/actions/scripts/TM.lua:213: in function <data/actions/scripts/TM.lua:115>

 

My TM.lua
 

Citar

idTM = {

[1452] = {tm = "Aurora Beam"},

[1453] = {tm = "Dragon Claw"},

[1454] = {tm = "Water Pulse"},

[1455] = {tm = "Hypnosis"},

[1456] = {tm = "Rest"},

[1457] = {tm = "Toxic"},

[1458] = {tm = "Draco Meteor"},

[1459] = {tm = "Lava Plume"},

[1460] = {tm = "Bullet Seed"},

[1461] = {tm = "Rock Blast"},

[1462] = {tm = "Pursuit"},

[1463] = {tm = "Bug Buzz"},

[1464] = {tm = "Ice Beam"},

[1465] = {tm = "Blizzard"},

[1466] = {tm = "Hyper Beam"},

[1467] = {tm = "Ancient Power"},

[1468] = {tm = "Power Gem"},

[1469] = {tm = "Rain Dance"},

[1470] = {tm = "Giga Drain"},

[1471] = {tm = "Petal Dance"},

[1472] = {tm = "Air Slash"},

[1473] = {tm = "Leaf Blade"},

[1474] = {tm = "Iron Tail"},

[1475] = {tm = "Thunder Bolt"},

[1476] = {tm = "Thunder"},

[1477] = {tm = "Earthquake"},

[1478] = {tm = "Dark Pulse"},

[12401] = {tm = "X-Scissor"},

[12402] = {tm = "Psychic"},

[12403] = {tm = "Shadow Ball"},

[12404] = {tm = "Brick Break"},

[12405] = {tm = "Tri-Attack"},

[12406] = {tm = "Restore"},

[12407] = {tm = "Falling Rocks"},

[12408] = {tm = "Flamethrower"},

[12409] = {tm = "Sludge Rain"},

[12410] = {tm = "Sand Tomb"},

[12411] = {tm = "Fire Blast"},

[12412] = {tm = "Wild Charge"},

[12413] = {tm = "Aerial Ace"},

[12414] = {tm = "Confusion"},





[12420] = {tm = "Crunch"},

[12421] = {tm = "Dragon Pulse"},

[12423] = {tm = "Fissure"},

[12426] = {tm = "Psy Ball"},

[12427] = {tm = "Hydro Pump"},

[12428] = {tm = "Steel Wing"},

[12429] = {tm = "Shadow Storm"},

[12430] = {tm = "Solar Beam"},

[12432] = {tm = "Overheat"},

 

 

}

 

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

 

if not idTM[item.itemid] then return false end

if not isPokeball(item2.itemid) then return false end

TM = idTM[item.itemid]

List = tmList[TM.tm]

if not isInArray(List.pokes, getItemAttribute(item2.uid, "poke")) then

doPlayerSendCancel(cid, "This pokemon don\'t learn "..TM.tm.."!")

return false

end

ID = 1

Have = "not"

Slot = ""

if haveFirstTM(item2) then

if getFirstTMName(item2) == TM.tm then

Have = "yes"

end

ID = ID + 1

end

if haveSecondTM(item2) then

if getSecondTMName(item2) == TM.tm then

Have = "yes"

end

ID = ID + 1

end

if haveThirdTM(item2) then

if getThirdTMName(item2) == TM.tm then

Have = "yes"

end

ID = ID + 1

end

if Have == "yes" then

doPlayerSendCancel(cid, "This pokemon have learned this TM!")

return false

end

if ID == 1 then

Slot = "First"

elseif ID == 2 then

Slot = "Second"

elseif ID == 3 then

Slot = "Third"

end

if haveAllTMs(item2) or ID == 4 or Slot == "" then

doPlayerSendCancel(cid, "This pokemon have number max of TMs!")

return false

end

 

addTM(item2, TM.tm, ID)

doRemoveItem(item.uid, 1)

doPlayerSendTextMessage(cid, 22, ""..getItemAttribute(item2.uid, "poke").." learn "..TM.tm.." on "..Slot.." Slot!")

return true

end

 

 

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

  • 3 months later...
A questão neste 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.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...