Ir para conteúdo

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? 

tfs 0.3.6

Qual o motivo deste tópico? 

não sei como finalizar essa spell.

Está surgindo algum erro? Se sim coloque-o aqui. 

Citar

[19/05/2024 15:34:35] [Error - LuaScriptInterface::loadFile] data/spells/scripts/maito gai/yagai.lua:99: 'end' expected (to close 'function' at line 67) near '<eof>'
[19/05/2024 15:34:35] [Warning - Event::loadScript] Cannot load script (data/spells/scripts/maito gai/yagai.lua)
[19/05/2024 15:34:35] data/spells/scripts/maito gai/yagai.lua:99: 'end' expected (to close 'function' at line 67) near '<eof>'
 

 

Você tem o código disponível? Se tiver publique-o aqui: 

 local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_ORANGE)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -135.8, 0, -140.9, 0)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_HITCOLOR, COLOR_RED)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -170.8, 0, -175.9, 0)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -150.8, 0, -155.9, 0)


local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end

local function onCastSpell2(parameters)
doCombat(parameters.cid, parameters.combat2, parameters.var)
end

local function onCastSpell3(parameters)
doCombat(parameters.cid, parameters.combat3, parameters.var)
end

function yagai1(cid)
	if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
		local position = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
		doSendMagicEffect(position, 399)
	end
end
function yagai2(cid)
	if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
		local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y+2, z=getThingPosition(getCreatureTarget(cid)).z}
		doSendMagicEffect(position, 411)
	end
end

function yagai3(cid)
	if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
		local position = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
		doSendMagicEffect(position, 398)
	end
end
function yagai4(cid)
	if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
		local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y+2, z=getThingPosition(getCreatureTarget(cid)).z}
		doSendMagicEffect(position, 396)
	end
end

function yagai5(cid)
	if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
		local position = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
		doSendMagicEffect(position, 438)
	end
end
function yagai6(cid)
	if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
		local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y+2, z=getThingPosition(getCreatureTarget(cid)).z}
		doSendMagicEffect(position, 439)
	end
end

function onCastSpell(cid, var)
local waittime = 3.0 -- Tempo de exhaustion
local storage = 143512 -- não mecha
local storage2 = 55512
if exhaustion.check(cid, storage) then
doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.")
return false
end 
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3}
if getPlayerStorageValue(cid, storage2) == 5 then
addEvent(onCastSpell2, 650, parameters)
addEvent(yagai3, 50, cid)
addEvent(yagai4, 650, cid)
else
if getPlayerStorageValue(cid, storage2) == 4 then
addEvent(onCastSpell2, 650, parameters)
addEvent(yagai3, 50, cid)
addEvent(yagai4, 650, cid)
else
if getPlayerStorageValue(cid, storage2) == 3 then
addEvent(onCastSpell3, 650, parameters)
addEvent(yagai5, 50, cid)
addEvent(yagai6, 650, cid)
else
addEvent(onCastSpell1, 650, parameters)
addEvent(yagai1, 50, cid)
addEvent(yagai2, 650, cid)
end
end
exhaustion.set(cid, storage, waittime)
return true
end

 

Estou tentando adicionar essa parte na script da spell e não estou tento exito.

 

if getPlayerStorageValue(cid, storage2) == 3 then
addEvent(onCastSpell3, 650, parameters)
addEvent(yagai5, 50, cid)
addEvent(yagai6, 650, cid)
else

 

quando adiciono essa parte na script da esse erro na distro:

 

[19/05/2024 15:34:35] [Error - LuaScriptInterface::loadFile] data/spells/scripts/maito gai/yagai.lua:99: 'end' expected (to close 'function' at line 67) near '<eof>'
[19/05/2024 15:34:35] [Warning - Event::loadScript] Cannot load script (data/spells/scripts/maito gai/yagai.lua)
[19/05/2024 15:34:35] data/spells/scripts/maito gai/yagai.lua:99: 'end' expected (to close 'function' at line 67) near '<eof>'

 

a spell ta pra mudar a cor dos efeitos e o dano quando o player esta transformado, com storage 3, 4 e 5, quando deixo so para a 4 e 5 funciona, quando tento adicionar a 3, não tenho exito, pois creio q não sei como fechar as linhas do else.

Resolvido por Fabi Marzan

Ir para solução
  • Respostas 5
  • Visualizações 178
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Gabrielx17
    Gabrielx17

    obrigado funcionou perfeitamente, consegui enteder tambem mais ou menos por cima de como usar o else pois não sabia que existia elseif! obrigado funcionou perfeitamente! e obrigado por me falar

  • Fabi Marzan
    Fabi Marzan

    Comecei a olhar seu código e você tinha um END demais.   local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_ORANGE) setCombatParam(combat1, COMBAT_PARAM

  • local combat1 = createCombatObject() setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_ORANGE) setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat1, COMBAT_FOR

Postado

todo IF sempre termina com END

 

ex:

if getPlayerStorageValue(cid, storage2) == 3 then
addEvent(onCastSpell3, 650, parameters)
addEvent(yagai5, 50, cid)
addEvent(yagai6, 650, cid)
else
--Function
end

 

Não sei muito inglês, mas até o próprio console informa.

'end' expected (to close 'function' at line 67) near '<eof>'

Postado
  • Autor
42 minutos atrás, Fabi Marzan disse:

todo IF sempre termina com END

 

ex:


if getPlayerStorageValue(cid, storage2) == 3 then
addEvent(onCastSpell3, 650, parameters)
addEvent(yagai5, 50, cid)
addEvent(yagai6, 650, cid)
else
--Function
end

 

Não sei muito inglês, mas até o próprio console informa.

'end' expected (to close 'function' at line 67) near '<eof>'

essa function no caso seria oq?

return false?

Postado
  • Solução
20 minutos atrás, Gabrielx17 disse:

essa function no caso seria oq?

return false?

Comecei a olhar seu código e você tinha um END demais.

 

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_ORANGE)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -135.8, 0, -140.9, 0)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_HITCOLOR, COLOR_RED)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -170.8, 0, -175.9, 0)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -150.8, 0, -155.9, 0)

local function onCastSpell1(parameters)
    doCombat(parameters.cid, parameters.combat1, parameters.var)
end

local function onCastSpell2(parameters)
    doCombat(parameters.cid, parameters.combat2, parameters.var)
end

local function onCastSpell3(parameters)
    doCombat(parameters.cid, parameters.combat3, parameters.var)
end

function yagai1(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {
            x = getThingPosition(getCreatureTarget(cid)).x + 1,
            y = getThingPosition(getCreatureTarget(cid)).y,
            z = getThingPosition(getCreatureTarget(cid)).z
        }
        doSendMagicEffect(position, 399)
    end
end

function yagai2(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {
            x = getThingPosition(getCreatureTarget(cid)).x + 2,
            y = getThingPosition(getCreatureTarget(cid)).y + 2,
            z = getThingPosition(getCreatureTarget(cid)).z
        }
        doSendMagicEffect(position, 411)
    end
end

function yagai3(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {
            x = getThingPosition(getCreatureTarget(cid)).x + 1,
            y = getThingPosition(getCreatureTarget(cid)).y,
            z = getThingPosition(getCreatureTarget(cid)).z
        }
        doSendMagicEffect(position, 398)
    end
end

function yagai4(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {
            x = getThingPosition(getCreatureTarget(cid)).x + 2,
            y = getThingPosition(getCreatureTarget(cid)).y + 2,
            z = getThingPosition(getCreatureTarget(cid)).z
        }
        doSendMagicEffect(position, 396)
    end
end

function yagai5(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {
            x = getThingPosition(getCreatureTarget(cid)).x + 1,
            y = getThingPosition(getCreatureTarget(cid)).y,
            z = getThingPosition(getCreatureTarget(cid)).z
        }
        doSendMagicEffect(position, 438)
    end
end

function yagai6(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {
            x = getThingPosition(getCreatureTarget(cid)).x + 2,
            y = getThingPosition(getCreatureTarget(cid)).y + 2,
            z = getThingPosition(getCreatureTarget(cid)).z
        }
        doSendMagicEffect(position, 439)
    end
end

function onCastSpell(cid, var)
    local waittime = 3.0 -- Tempo de exhaustion
    local storage = 143512 -- não mecha
    local storage2 = 55512

    if exhaustion.check(cid, storage) then
        doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.")
        return false
    end

    local parameters = {cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3}

    if getPlayerStorageValue(cid, storage2) == 5 then
        addEvent(onCastSpell2, 650, parameters)
        addEvent(yagai3, 50, cid)
        addEvent(yagai4, 650, cid)
    elseif getPlayerStorageValue(cid, storage2) == 4 then
        addEvent(onCastSpell2, 650, parameters)
        addEvent(yagai3, 50, cid)
        addEvent(yagai4, 650, cid)
    elseif getPlayerStorageValue(cid, storage2) == 3 then
        addEvent(onCastSpell3, 650, parameters)
        addEvent(yagai5, 50, cid)
        addEvent(yagai6, 650, cid)
    else
        addEvent(onCastSpell1, 650, parameters)
        addEvent(yagai1, 50, cid)
        addEvent(yagai2, 650, cid)
    end
    exhaustion.set(cid, storage, waittime)
    return true
end

 

Postado
  • Diretor
7 horas atrás, Gabrielx17 disse:

.Qual servidor ou website você utiliza como base? 

tfs 0.3.6

Qual o motivo deste tópico? 

não sei como finalizar essa spell.

Está surgindo algum erro? Se sim coloque-o aqui. 

 

Você tem o código disponível? Se tiver publique-o aqui: 



 local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_ORANGE)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -135.8, 0, -140.9, 0)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_HITCOLOR, COLOR_RED)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -170.8, 0, -175.9, 0)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -150.8, 0, -155.9, 0)


local function onCastSpell1(parameters)
doCombat(parameters.cid, parameters.combat1, parameters.var)
end

local function onCastSpell2(parameters)
doCombat(parameters.cid, parameters.combat2, parameters.var)
end

local function onCastSpell3(parameters)
doCombat(parameters.cid, parameters.combat3, parameters.var)
end

function yagai1(cid)
	if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
		local position = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
		doSendMagicEffect(position, 399)
	end
end
function yagai2(cid)
	if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
		local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y+2, z=getThingPosition(getCreatureTarget(cid)).z}
		doSendMagicEffect(position, 411)
	end
end

function yagai3(cid)
	if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
		local position = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
		doSendMagicEffect(position, 398)
	end
end
function yagai4(cid)
	if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
		local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y+2, z=getThingPosition(getCreatureTarget(cid)).z}
		doSendMagicEffect(position, 396)
	end
end

function yagai5(cid)
	if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
		local position = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
		doSendMagicEffect(position, 438)
	end
end
function yagai6(cid)
	if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
		local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y+2, z=getThingPosition(getCreatureTarget(cid)).z}
		doSendMagicEffect(position, 439)
	end
end

function onCastSpell(cid, var)
local waittime = 3.0 -- Tempo de exhaustion
local storage = 143512 -- não mecha
local storage2 = 55512
if exhaustion.check(cid, storage) then
doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.")
return false
end 
local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3}
if getPlayerStorageValue(cid, storage2) == 5 then
addEvent(onCastSpell2, 650, parameters)
addEvent(yagai3, 50, cid)
addEvent(yagai4, 650, cid)
else
if getPlayerStorageValue(cid, storage2) == 4 then
addEvent(onCastSpell2, 650, parameters)
addEvent(yagai3, 50, cid)
addEvent(yagai4, 650, cid)
else
if getPlayerStorageValue(cid, storage2) == 3 then
addEvent(onCastSpell3, 650, parameters)
addEvent(yagai5, 50, cid)
addEvent(yagai6, 650, cid)
else
addEvent(onCastSpell1, 650, parameters)
addEvent(yagai1, 50, cid)
addEvent(yagai2, 650, cid)
end
end
exhaustion.set(cid, storage, waittime)
return true
end

 

Estou tentando adicionar essa parte na script da spell e não estou tento exito.

 

if getPlayerStorageValue(cid, storage2) == 3 then
addEvent(onCastSpell3, 650, parameters)
addEvent(yagai5, 50, cid)
addEvent(yagai6, 650, cid)
else

 

quando adiciono essa parte na script da esse erro na distro:

 

[19/05/2024 15:34:35] [Error - LuaScriptInterface::loadFile] data/spells/scripts/maito gai/yagai.lua:99: 'end' expected (to close 'function' at line 67) near '<eof>'
[19/05/2024 15:34:35] [Warning - Event::loadScript] Cannot load script (data/spells/scripts/maito gai/yagai.lua)
[19/05/2024 15:34:35] data/spells/scripts/maito gai/yagai.lua:99: 'end' expected (to close 'function' at line 67) near '<eof>'

 

a spell ta pra mudar a cor dos efeitos e o dano quando o player esta transformado, com storage 3, 4 e 5, quando deixo so para a 4 e 5 funciona, quando tento adicionar a 3, não tenho exito, pois creio q não sei como fechar as linhas do else.

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_HITCOLOR, COLOR_ORANGE)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -135.8, 0, -140.9, 0)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_HITCOLOR, COLOR_RED)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -170.8, 0, -175.9, 0)

local combat3 = createCombatObject()
setCombatParam(combat3, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatFormula(combat3, COMBAT_FORMULA_LEVELMAGIC, -150.8, 0, -155.9, 0)

local function onCastSpell1(parameters)
    doCombat(parameters.cid, parameters.combat1, parameters.var)
end

local function onCastSpell2(parameters)
    doCombat(parameters.cid, parameters.combat2, parameters.var)
end

local function onCastSpell3(parameters)
    doCombat(parameters.cid, parameters.combat3, parameters.var)
end

function yagai1(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
        doSendMagicEffect(position, 399)
    end
end

function yagai2(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y+2, z=getThingPosition(getCreatureTarget(cid)).z}
        doSendMagicEffect(position, 411)
    end
end

function yagai3(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
        doSendMagicEffect(position, 398)
    end
end

function yagai4(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y+2, z=getThingPosition(getCreatureTarget(cid)).z}
        doSendMagicEffect(position, 396)
    end
end

function yagai5(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
        doSendMagicEffect(position, 438)
    end
end

function yagai6(cid)
    if isCreature(cid) and isCreature(getCreatureTarget(cid)) then
        local position = {x=getThingPosition(getCreatureTarget(cid)).x+2, y=getThingPosition(getCreatureTarget(cid)).y+2, z=getThingPosition(getCreatureTarget(cid)).z}
        doSendMagicEffect(position, 439)
    end
end

function onCastSpell(cid, var)
    local waittime = 3.0 -- Tempo de exhaustion
    local storage = 143512 -- não mecha
    local storage2 = 55512
    if exhaustion.check(cid, storage) then
        doPlayerSendCancel(cid, "Aguarde " .. exhaustion.get(cid, storage) .. " segundos para usar a spell novamente.")
        return false
    end 
    local parameters = { cid = cid, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3}
    if getPlayerStorageValue(cid, storage2) == 5 then
        addEvent(onCastSpell2, 650, parameters)
        addEvent(yagai3, 50, cid)
        addEvent(yagai4, 650, cid)
    elseif getPlayerStorageValue(cid, storage2) == 4 then
        addEvent(onCastSpell2, 650, parameters)
        addEvent(yagai3, 50, cid)
        addEvent(yagai4, 650, cid)
    elseif getPlayerStorageValue(cid, storage2) == 3 then
        addEvent(onCastSpell3, 650, parameters)
        addEvent(yagai5, 50, cid)
        addEvent(yagai6, 650, cid)
    else
        addEvent(onCastSpell1, 650, parameters)
        addEvent(yagai1, 50, cid)
        addEvent(yagai2, 650, cid)
    end
    exhaustion.set(cid, storage, waittime)
    return true
end

erro: 

function onCastSpell(cid, var) 

não tava fechada

Editado por L3K0T (veja o histórico de edições)

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo