TO
pedido

Me ajuda com o meu onTextEdit

Por tonynamoral, 07 de jan. de 2013 em Scripts

script
7
1.1k
tonynamoralT
07 de janeiro de 2013 às 12:08

Fala ai galera , eu tenho 2 scripts de onTextEdit aki

porém , quando eu criei o outro que ilhei apilidar de ² , quando eu ponho numeros para funcionar o script ¹ , o ² parece que trava ele

 

script :

local spellsb = {
["energy explosion"] = 2378,
["gale"] = 2385,
["twisting slash"] = 2376,
["elemental hits"] = 2377,
["meteor"] = 2382,
}

local spellsbids = {2390,2391,2392,2393,2394,2395,2396,2397,2398}

function onTextEdit(cid,item,newText)
for a = 1, #spellsbids do
local texte = {"energy explosion","gale","twisting slash","elemental hits","meteor"}
for b = 1, #texte do
if not texte[b] then
doPlayerSendTextMessage(cid,27,"Spell dont exist.")
return true
end
   if item.itemid == spellsbids[a] then
          uid = spellsb[newText]
 doSendMagicEffect(getThingPos(cid),30)
          doTransformItem(item.uid, uid)
   end
end
end

 

Please HELP -- nenhum erro no distro

OneshotO
07 de janeiro de 2013 às 12:40

Coloque return true antes do último end nos dois

Editado Janeiro 7 por Oneshot

tonynamoralT
07 de janeiro de 2013 às 12:50

assim ?

 

 

local spellsb = {

["energy explosion"] = 2378,

["gale"] = 2385,

["twisting slash"] = 2376,

["elemental hits"] = 2377,

["meteor"] = 2382,

}

 

local spellsbids = {2390,2391,2392,2393,2394,2395,2396,2397,2398}

 

function onTextEdit(cid,item,newText)

for a = 1, #spellsbids do

local texte = {"energy explosion","gale","twisting slash","elemental hits","meteor"}

for b = 1, #texte do

if not texte then

doPlayerSendTextMessage(cid,27,"Spell dont exist.")

return true

end

if item.itemid == spellsbids[a] then

uid = spellsb[newText]

doSendMagicEffect(getThingPos(cid),30)

doTransformItem(item.uid, uid)

end

return true

end

return true

end

SlicerS
07 de janeiro de 2013 às 12:53

soh o ultimo mano.. ele flo pra por nos 2 scripts, o ¹ e ².. antes do ultimo 'end'

brun123B
07 de janeiro de 2013 às 12:55

Use a script assim:

 

local spellsb = {
["energy explosion"] = 2378,
["gale"] = 2385,
["twisting slash"] = 2376,
["elemental hits"] = 2377,
["meteor"] = 2382,
}

local spellsbids = {2390, 2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398}

function onTextEdit(cid,item,newText)

   if not isInArray(spellsbids, item.itemid) then return true end    

   local spell = spellsb[newText:lower()]

   if not spell then
    doPlayerSendCancel(cid, "Spell doesn't exist.")
   return false
   end

   doSendMagicEffect(getThingPos(cid), 30)
   doTransformItem(item.uid, spell)

return false
end

tonynamoralT
07 de janeiro de 2013 às 13:00

Obrigado

SlicerS
07 de janeiro de 2013 às 14:45

acredito q sanado, movido