Ir para conteúdo

Featured Replies

Postado

Lua Script Error: [Spell Interface] 
data/spells/scripts/support/levitate.lua:onCastSpell 
data/spells/scripts/support/levitate.lua:13: attempt to call method 'move' (a nil value) 
stack traceback: 
[C]: in function 'move' 
data/spells/scripts/support/levitate.lua:13: in function 'levitate' 
data/spells/scripts/support/levitate.lua:21: in function 

 

 

 

meu spells

        <instant group="support" spellid="81" name="Levitate" words="exani hur" lvl="12" mana="50" prem="1" aggressive="0" cooldown="200" groupcooldown="200" params="1" needlearn="0" script="support/levitate.lua">
                <vocation name="Sorcerer"/>
                <vocation name="Druid"/>
                <vocation name="Paladin"/>
                <vocation name="Knight"/>
                <vocation name="Master Sorcerer"/>
                <vocation name="Elder Druid"/>
                <vocation name="Royal Paladin"/>
                <vocation name="Elite Knight"/>
        </instant>
        <instant group="support" spellid="10" name="Light" words="utevo lux" lvl="8" mana="20" aggressive="0" selftarget="1" exhaustion="200" groupcooldown="200" needlearn="0" script="support/light.lua">
                <vocation name="Sorcerer"/>
                <vocation name="Druid"/>
                <vocation name="Paladin"/>
                <vocation name="Knight"/>
                <vocation name="Master Sorcerer"/>
                <vocation name="Elder Druid"/>
                <vocation name="Royal Paladin"/>
                <vocation name="Elite Knight"/>

 

meu levitate.lua

local function levitate(creature, parameter)
    local fromPosition = creature:getPosition()

    if parameter == "up" and fromPosition.z ~= 8 or parameter == "down" and fromPosition.z ~= 7 then
        local toPosition = creature:getPosition()
        toPosition:getNextPosition(creature:getDirection())

        local tile = Tile(parameter == "up" and Position(fromPosition.x, fromPosition.y, fromPosition.z - 1) or toPosition)
        if not tile or not tile:getGround() and not tile:hasFlag(parameter == "up" and TILESTATE_IMMOVABLEBLOCKSOLID or TILESTATE_BLOCKSOLID) then
            tile = Tile(toPosition.x, toPosition.y, toPosition.z + (parameter == "up" and -1 or 1))

            if tile and tile:getGround() and not tile:hasFlag(bit.bor(TILESTATE_IMMOVABLEBLOCKSOLID, TILESTATE_FLOORCHANGE)) then
                return creature:move(tile, bit.bor(FLAG_IGNOREBLOCKITEM, FLAG_IGNOREBLOCKCREATURE))
            end
        end
    end
    return RETURNVALUE_NOTPOSSIBLE
end

function onCastSpell(creature, variant)
    local returnValue = levitate(creature, variant:getString())
    if returnValue ~= RETURNVALUE_NOERROR then
        creature:sendCancelMessage(returnValue)
        creature:getPosition():sendMagicEffect(CONST_ME_POFF)
        return false
    end

    creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
    return true
end




AJUDEM POR FAVOR

  • 11 months later...

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.7k

Informação Importante

Confirmação de Termo