Ir para conteúdo

Featured Replies

Postado

Olá Tk, eu gostaria de ajuda para arrumar um script que não esta funcionando  muito bem.

 

O Script é esse



function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local itemId = item:getId()
    if not player:isPremium() then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Only premium players can pass.")
        return true
    end
    if table.contains(horizontalOpenDoors, itemId) or table.contains(verticalOpenDoors, itemId) then
        local doorCreature = Tile(toPosition):getTopCreature()
        if doorCreature ~= nil then
            toPosition.x = toPosition.x + 1
            local query = Tile(toPosition):queryAdd(doorCreature, bit.bor(FLAG_IGNOREBLOCKCREATURE, FLAG_PATHFINDING))
            if query ~= RETURNVALUE_NOERROR then
                toPosition.x = toPosition.x - 1
                toPosition.y = toPosition.y + 1
                query = Tile(toPosition):queryAdd(doorCreature, bit.bor(FLAG_IGNOREBLOCKCREATURE, FLAG_PATHFINDING))
            end

            if query ~= RETURNVALUE_NOERROR then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, query)
                return true
            end
            doorCreature:teleportTo(toPosition, true)
        end

        if not table.contains(openSpecialDoors, itemId) then
            item:transform(itemId - 1)
        end
        return true
    else
        item:transform(itemId + 1)
        player:teleportTo(toPosition, true)
    end
    return true
end

 

Actions.xml esta assim.

 

<action uniqueid="9050" script="premiumdoor.lua"/>

 

 

Isso é como esta a porta.



23:59 You see a gate of expertise for level 60.


Item ID: 6265, Action ID: 1060, Unique ID: 9050.
Position: 435, 283, 3

izw7S007SEyILQBft_1rsQ.png

 

 

Esse erro aparece no console

 

 

Dc6ogSJnQ4_m4XX4NkKPmA.png

Resolvido por Dwarfer

Ir para solução
  • 2 weeks later...
Postado
  • Solução
Spoiler

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local itemId = item:getId()
    if not player:isPremium() then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Only premium players can pass.")
        return true
    end
    if isInArray(horizontalOpenDoors, itemId) or isInArray(verticalOpenDoors, itemId) then
        local doorCreature = Tile(toPosition):getTopCreature()
        if doorCreature ~= nil then
            toPosition.x = toPosition.x + 1
            local query = Tile(toPosition):queryAdd(doorCreature, bit.bor(FLAG_IGNOREBLOCKCREATURE, FLAG_PATHFINDING))
            if query ~= RETURNVALUE_NOERROR then
                toPosition.x = toPosition.x - 1
                toPosition.y = toPosition.y + 1
                query = Tile(toPosition):queryAdd(doorCreature, bit.bor(FLAG_IGNOREBLOCKCREATURE, FLAG_PATHFINDING))
            end 

            if query ~= RETURNVALUE_NOERROR then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, query)
                return true
            end
            doorCreature:teleportTo(toPosition, true)
        end 

        if not isInArray(openSpecialDoors, itemId) then
            item:transform(itemId - 1)
        end
        return true
    else
        item:transform(itemId + 1)
        player:teleportTo(toPosition, true)
    end
    return true
end 

 

 

Contato:

 

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