Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

Alguém coloca a storage nessa alavanca? Os players que forem teletransportados não poderão entrar de novo em 24h

local config = {
    requiredLevel = 100,
    daily = false,
    playerPositions = {
        Position(33010, 31660, 14),
        Position(33010, 31661, 14),
        Position(33010, 31662, 14),
        Position(33010, 31663, 14),
        Position(33010, 31664, 14)
    },
    newPositions = {
        Position(32974, 31670, 14),
        Position(32975, 31670, 14),
        Position(32976, 31670, 14),
        Position(32977, 31670, 14),
        Position(32978, 31670, 14)
    },
    BossPositions = {
        Position(32977, 31658, 14)
    }
}


function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 1946 then
        local storePlayers, playerTile = {}

        for i = 1, #config.playerPositions do
            playerTile = Tile(config.playerPositions):getTopCreature()
            if not playerTile or not playerTile:isPlayer() then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need 5 players.")
                return true
            end

            if playerTile:getLevel() < config.requiredLevel then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.")
                return true
            end

            storePlayers[#storePlayers + 1] = playerTile
        end

        for i = 1, #config.BossPositions do
            Game.createMonster("The Time Guardian", config.BossPositions)
        end

        local players
        for i = 1, #storePlayers do
            players = storePlayers
            config.playerPositions:sendMagicEffect(CONST_ME_POFF)
            players:teleportTo(config.newPositions)
            config.newPositions:sendMagicEffect(CONST_ME_ENERGYAREA)
            players:setDirection(DIRECTION_EAST)
        end
    elseif item.itemid == 1945 then
        if config.daily then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
            return true
        end
    end

    item:transform(item.itemid == 1946 and 1945 or 1946)
    return true
end

 

 

Resolvido por Vodkart

Ir para solução
  • Respostas 13
  • Visualizações 1.2k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • FlavioHulk
    FlavioHulk

    local config = { requiredLevel = 100, daily = false, playerPositions = { Position(33010, 31660, 14), Position(33010, 31661, 14), Position(33010, 31662, 14),

Postado
local config = {
    requiredLevel = 100,
    daily = false,
    playerPositions = {
        Position(33010, 31660, 14),
        Position(33010, 31661, 14),
        Position(33010, 31662, 14),
        Position(33010, 31663, 14),
        Position(33010, 31664, 14)
    },
    newPositions = {
        Position(32974, 31670, 14),
        Position(32975, 31670, 14),
        Position(32976, 31670, 14),
        Position(32977, 31670, 14),
        Position(32978, 31670, 14)
    },
    BossPositions = {
        Position(32977, 31658, 14)
    }
}


function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid == 1946 then
        local storePlayers, playerTile = {}

        for i = 1, #config.playerPositions do
            playerTile = Tile(config.playerPositions):getTopCreature()
            if not playerTile or not playerTile:isPlayer() then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need 5 players.")
                return true
            end

            if playerTile:getLevel() < config.requiredLevel then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.")
                return true
            end

            storePlayers[#storePlayers + 1] = playerTile
        end

        for i = 1, #config.BossPositions do
            Game.createMonster("The Time Guardian", config.BossPositions)
        end

        local players
        for i = 1, #storePlayers do
            players = storePlayers[i]
            players:getPosition():sendMagicEffect(CONST_ME_POFF)
            players:teleportTo(config.newPositions[i])
            players:getPosition():sendMagicEffect(CONST_ME_ENERGYAREA)
            players:setDirection(DIRECTION_EAST)
            players:setExhaustion(StorageEscolhida, 24 * 60 * 60) -- Aqui é onde você escolhe a storage
        end
    elseif item.itemid == 1945 then
        if config.daily then
            player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
            return true
        end
    end

    item:transform(item.itemid == 1946 and 1945 or 1946)
    return true
end

 

Postado
46 minutos atrás, Obito disse:

Flávio eu puxo alavanca e ela não vai

Aproveitando tem como deixa ela ser puxada tanto com 1 jogador quanto os 5?

Qual o erro? Algum erro no console?

 

Lembrando: na linha onde tem 'Storage Escolhida' você deve colocar uma storage qualquer

Editado por FlavioHulk (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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo