FL

[Resolvido] Morph

Por FlamesAdmin, 10 de jun. de 2015 em Resolvidos

script
resolvido
9
2.5k
10 de junho de 2015 às 02:47

Fiz uma tag de outro pokemon pra usar o Morph copiando dessa tag:

if getCreatureName(cid) == "Shiny Abra" then
 eff, name, outfit = lightEff, "Light Abra", lightOut
 else
 eff, name, outfit = darkEff, "Shiny Abra", darkOut
 end

Só que está dando erro.

[10/06/2015 02:46:33] [Error - LuaScriptInterface::loadFile] data/lib/pokemon moves.lua:2659: unexpected symbol near '=='

[10/06/2015 02:46:33] [Warning - LuaScriptInterface::initState] Cannot load data/lib/
[10/06/2015 02:46:33] [Error - LuaScriptInterface::loadFile] data/lib/pokemon moves.lua:2659: unexpected symbol near '=='
[10/06/2015 02:46:33] [Warning - LuaScriptInterface::initState] Cannot load data/lib/
[10/06/2015 02:46:33] [Error - LuaScriptInterface::loadFile] data/lib/pokemon moves.lua:2659: unexpected symbol near '=='
[10/06/2015 02:46:33] [Warning - LuaScriptInterface::initState] Cannot load data/lib/
[10/06/2015 02:46:33] [Error - LuaScriptInterface::loadFile] data/actions/scripts/evolution.lua:48: '}' expected (to close '{' at line 3) near '['
[10/06/2015 02:46:33] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/evolution.lua)
[10/06/2015 02:46:33] data/actions/scripts/evolution.lua:48: '}' expected (to close '{' at line 3) near '['
[10/06/2015 02:46:33] [Error - LuaScriptInterface::loadFile] data/lib/pokemon moves.lua:2659: unexpected symbol near '=='
[10/06/2015 02:46:33] [Warning - LuaScriptInterface::initState] Cannot load data/lib/
[10/06/2015 02:46:34] [Error - LuaScriptInterface::loadFile] data/lib/pokemon moves.lua:2659: unexpected symbol near '=='
[10/06/2015 02:46:34] [Warning - LuaScriptInterface::initState] Cannot load data/lib/
[10/06/2015 02:46:34] [Error - LuaScriptInterface::loadFile] data/lib/pokemon moves.lua:2659: unexpected symbol near '=='
[10/06/2015 02:46:34] [Warning - LuaScriptInterface::initState] Cannot load data/lib/

Morph:

elseif spell == "Morph" then

if isSummon(cid) then
sid = getCreatureMaster(cid)

lightEff = 132
lightOut = 1645
darkEff = 214
darkOut = 1257
 -----------Rotoms
ghostEff = 180
ghostOut = 1730
waterEff = 21
waterOut = 1726
fireEff = 181
fireOut = 1725
grassEff = 8
grassOut = 1729
flyEff = 42
flyOut = 1727
iceEff = 41
iceOut = 1728
pos = getThingPos(cid)

 if getPlayerSlotItem(sid, 8).itemid == 0 then
 print(getPlayerSlotItem(sid, 8).itemid)
 return false
 end
 if getCreatureName(cid) == "Shiny Abra" then
 eff, name, outfit = lightEff, "Light Abra", lightOut
 else
 eff, name, outfit = darkEff, "Shiny Abra", darkOut
 end
if getCreatureName(cid) == "Ghost Rotom" then     --- ADICIONANDO ESSA PARTE \/
eff, name, outfit = waterEff, "Water Rotom", waterOut
else
eff, name, outfit = fireEff, "Fire Rotom", fireOut
else
eff, name, outfit = grassEff, "Grass Rotom", grassOut
else
eff, name, outfit = flyEff, "Flying Rotom", flyOut
else
eff, name, outfit = iceEff, "Ice Rotom", iceOut
else
eff, name, outfit = ghostEff, "Ghost Rotom", ghostOut
end             ---- ATÉ AQUI DA ERRO, QUANDO EU TIRO ELA, INICIA NORMALMENTE
 if not isPlayer(sid) then return false end
 if getItemAttribute(getPlayerSlotItem(sid, 8).uid, "ghostlight") then
  doItemEraseAttribute(getPlayerSlotItem(sid, 8).uid, "ghostlight")
 else
  doItemSetAttribute(getPlayerSlotItem(sid, 8).uid, "ghostlight", "yes")
 end
 doSendMagicEffect(getThingPosWithDebug(cid), eff)
 doSetCreatureOutfit(cid, {lookType = outfit}, -1)
 doItemSetAttribute(getPlayerSlotItem(sid, 8).uid, "poke", name)
 doRemoveCreature(cid)
 doSummonMonster(sid, name)
 doTeleportThing(getCreatureSummons(sid)[1], pos, false)
 adjustStatus(getCreatureSummons(sid)[1], getPlayerSlotItem(sid, 8).uid, true, false)
doUpdateMoves(sid)
end

Parte que eu quero colocar pro outro poke usar: O erro só acontece quando eu adiciono \/.
if getCreatureName(cid) == "Ghost Rotom" then
 eff, name, outfit = waterEff, "Water Rotom", waterOut
 else
 eff, name, outfit = fireEff, "Fire Rotom", fireOut
  else
 eff, name, outfit = grassEff, "Grass Rotom", grassOut
  else
 eff, name, outfit = flyEff, "Flying Rotom", flyOut
  else
 eff, name, outfit = iceEff, "Ice Rotom", iceOut
  else
 eff, name, outfit = ghostEff, "Ghost Rotom", ghostOut
 end

 

Rep+ pela ajuda.

Editado Junho 10 por FlamesAdmin

Luga03L
10 de junho de 2015 às 07:40

Tenta Isto:

 

 

if getCreatureName(cid) = "Shiny Abra" then
eff, name, outfit = lightEff, "Light Abra", lightOut
else
eff, name, outfit = darkEff, "Shiny Abra", darkOut
end
10 de junho de 2015 às 07:48

Não é bem isso que eu quero, do Dark Abra e Light está funcionando, quero que funcione com os Rotoms também, pois quando eu coloco a parte dos Rotoms ele da erro. Igual com Dark Abra

 

#Edit

Editei o tópico para melhor entender.

Editado Junho 10 por FlamesAdmin

SkymagnumS
10 de junho de 2015 às 13:21

 

 
if getCreatureName(cid) == "Ghost Rotom" then
eff, name, outfit = ghostEff, "Ghost Rotom", ghostOut
elseif getCreatureName(cid) == "Fire Rotom" then
eff, name, outfit = fireEff, "Fire Rotom", fireOut
  elseif getCreatureName(cid) == "Grass Rotom" then
eff, name, outfit = grassEff, "Grass Rotom", grassOut
  elseif getCreatureName(cid) == "Flying Rotom" then
eff, name, outfit = flyEff, "Flying Rotom", flyOut
  elseif getCreatureName(cid) == "Ice Rotom" then
eff, name, outfit = iceEff, "Ice Rotom", iceOut
  else
eff, name, outfit = waterEff, "Water Rotom", waterOut
end

Editado Junho 10 por Skymagnum

10 de junho de 2015 às 15:16

Bom, quando uso Morph no Shiny Abra, ele transforma no Water Rotom. E quando uso Morph com todas formas do Rotom, nada acontece, continua na mesma forma. Eu quero que o Morph funcione entre o Shiny Abra e Light Abra. E com os Rotoms a mesma coisa, Ghost muda pro Water, Water pro Fire, Fire pro Grass, Grass pro Flying, Flying pro Ice, Ice pro Water e Water pro Ghost.

SkymagnumS
10 de junho de 2015 às 16:05
Melhor resposta

 

 
local _TAB = {
["Shiny Abra"] = {eff = lightEff, name = "Light Abra", outfit = lightOut},
["Light Abra"] = {eff = darkEff, name = "Shiny Abra", outfit = darkOut},
["Ghost Rotom"] = {eff = waterEff, name = "Water Rotom", outfit = waterOut},
["Water Rotom"] = {eff = fireEff, name = "Fire Rotom", outfit = fireOut},
["Fire Rotom"] = {eff = grassEff, name = "Grass Rotom", outfit = grassOut},
["Grass Rotom"] = {eff = flyEff, name = "Flying Rotom", outfit = flyOut},
["Flying Rotom"] = {eff = iceEff, name = "Ice Rotom", outfit = iceOut},
["Ice Rotom"] = {eff = ghostEff, name = "Ghost Rotom", outfit = ghostOut}
}
 
local infos = _TAB[getCreatureName(cid)]
 
if infos then
eff, name, outfit = infos.eff, infos.name, infos.outfit
end
11 de junho de 2015 às 00:36

Deu certo, obrigado pela ajuda.

1 mês depois...
BrunoB
14 de julho de 2015 às 17:56

Tópico movido para dúvidas / pedidos resolvidos.

2 anos depois...
FrenviusF
29 de novembro de 2017 às 14:22
A questão neste tópico de suporte foi respondida e/ou o autor do tópico resolveu o problema. Este tópico está fechado e foi movido para Suporte - Resolvidos. Se você tiver outras dúvidas, crie um novo tópico.