• TibiaFace

    Tibiaface | Una comunidad Open Tibia donde encontras : mapas, scripts, Otserver, npc y amigos etc ...

    .
    demo menumenu

    Afiliados



    Votar:

    [Problema] exausted lever

    Compartir:

    Ver el tema anterior Ver el tema siguiente Ir abajo  Mensaje (Página 1 de 1.)

    1[Problema] exausted lever Empty [Problema] exausted lever Vie Jun 17, 2022 12:15 pm

    Dfsuno

    Dfsuno
    Miembro
    Miembro
    Descripcion escribió:me podrían ayudar a ponerle exausted a la palanca, de 15 hrs igual sigo intentando ponerlo yo mismo si termino lo posteo, gracias. Very Happy

    Código:
    local setting = {
     centerRoom = {x = 516, y = 168, z = 10},
     storage = 7631,
     Pillar1pos = {x = 440, y = 669, z = 10},
     bossPosition = {x = 514, y = 162, z = 10},
     kickPosition = {x = 496, y = 168, z = 10},
     playerTeleport = {x = 514, y = 173, z = 10}
    }

    local gnome = Action()

    -- Start Script
    function gnome.onUse(creature, item, fromPosition, target, toPosition, isHotkey)
     if item.itemid == 1945 and item.actionid == 49131 then

     local clearOberonRoom = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)      
     for index, spectatorcheckface in ipairs(clearOberonRoom) do
     if spectatorcheckface:isPlayer() then
     creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting against the boss! You need wait awhile.")
     return false
     end
     end
     for index, removeOberon in ipairs(clearOberonRoom) do
     if (removeOberon:isMonster()) then
     removeOberon:remove()
     end
     end
     Game.createMonster("Lost Gnome", setting.bossPosition, false, true)
     Game.createMonster("", Position({x = setting.Pillar1pos.x, y = setting.Pillar1pos.y, z = setting.Pillar1pos.z}), false, true)

     
     local players = {}
     for i = 0, 0 do
     local player1 = Tile({x = (Position(item:getPosition()).x + 1) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
     local player2 = Tile({x = (Position(item:getPosition()).x + 2) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
     local player3 = Tile({x = (Position(item:getPosition()).x + 3) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
     local player4 = Tile({x = (Position(item:getPosition()).x + 4) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
     local player5 = Tile({x = (Position(item:getPosition()).x + 5) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
     players[#players+1] = player1
     players[#players+1] = player2
     players[#players+1] = player3
     players[#players+1] = player4
     players[#players+1] = player5
     end
     for i, player in ipairs(players) do
     player:getPosition():sendMagicEffect(CONST_ME_POFF)
     player:teleportTo(Position(setting.playerTeleport), false)
     doSendMagicEffect(player:getPosition(), CONST_ME_TELEPORT)
     setPlayerStorageValue(player,setting.storage, os.time() + 10 * 60 * 60)
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have 10 minute(s) to to kill all respawn.')
     addEvent(function()
     local spectatorsjivans = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)
     for u = 1, #spectatorsjivans, 1 do
     if spectatorsjivans[u]:isPlayer() and (spectatorsjivans[u]:getName() == player:getName()) then
     player:teleportTo(Position(setting.kickPosition))
     player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
     player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Time is over.')
     end
     end
     end, 10 * 60 * 1000)
     end
     end
     return true
    end

    gnome:aid(49131)
    gnome:register()
    Captura del Error escribió:Imagen del error: [Problema] exausted lever Empty
    La config. radica en: Actions

    2 participantes

    2[Problema] exausted lever Empty Re: [Problema] exausted lever Vie Jun 17, 2022 1:18 pm

    SoyFabi

    SoyFabi
    Miembro
    Miembro
    Dfsuno escribió:
    Descripcion escribió:me podrían ayudar a ponerle exausted a la palanca, de 15 hrs igual sigo intentando ponerlo yo mismo si termino lo posteo, gracias. Very Happy

    Código:
    local setting = {
     centerRoom = {x = 516, y = 168, z = 10},
     storage = 7631,
     Pillar1pos = {x = 440, y = 669, z = 10},
     bossPosition = {x = 514, y = 162, z = 10},
     kickPosition = {x = 496, y = 168, z = 10},
     playerTeleport = {x = 514, y = 173, z = 10}
    }

    local gnome = Action()

    -- Start Script
    function gnome.onUse(creature, item, fromPosition, target, toPosition, isHotkey)
     if item.itemid == 1945 and item.actionid == 49131 then

     local clearOberonRoom = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)      
     for index, spectatorcheckface in ipairs(clearOberonRoom) do
     if spectatorcheckface:isPlayer() then
     creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting against the boss! You need wait awhile.")
     return false
     end
     end
     for index, removeOberon in ipairs(clearOberonRoom) do
     if (removeOberon:isMonster()) then
     removeOberon:remove()
     end
     end
     Game.createMonster("Lost Gnome", setting.bossPosition, false, true)
     Game.createMonster("", Position({x = setting.Pillar1pos.x, y = setting.Pillar1pos.y, z = setting.Pillar1pos.z}), false, true)

     
     local players = {}
     for i = 0, 0 do
     local player1 = Tile({x = (Position(item:getPosition()).x + 1) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
     local player2 = Tile({x = (Position(item:getPosition()).x + 2) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
     local player3 = Tile({x = (Position(item:getPosition()).x + 3) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
     local player4 = Tile({x = (Position(item:getPosition()).x + 4) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
     local player5 = Tile({x = (Position(item:getPosition()).x + 5) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
     players[#players+1] = player1
     players[#players+1] = player2
     players[#players+1] = player3
     players[#players+1] = player4
     players[#players+1] = player5
     end
     for i, player in ipairs(players) do
     player:getPosition():sendMagicEffect(CONST_ME_POFF)
     player:teleportTo(Position(setting.playerTeleport), false)
     doSendMagicEffect(player:getPosition(), CONST_ME_TELEPORT)
     setPlayerStorageValue(player,setting.storage, os.time() + 10 * 60 * 60)
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have 10 minute(s) to to kill all respawn.')
     addEvent(function()
     local spectatorsjivans = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)
     for u = 1, #spectatorsjivans, 1 do
     if spectatorsjivans[u]:isPlayer() and (spectatorsjivans[u]:getName() == player:getName()) then
     player:teleportTo(Position(setting.kickPosition))
     player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
     player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Time is over.')
     end
     end
     end, 10 * 60 * 1000)
     end
     end
     return true
    end

    gnome:aid(49131)
    gnome:register()
    Captura del Error escribió:Imagen del error: [Problema] exausted lever Empty
    La config. radica en: Actions

    Prueba asi:
    Código:
    local setting = {
     centerRoom = {x = 516, y = 168, z = 10},
     storage = 7631,
     exhausted_time = 15, -- Time in Hours (15h)
     Pillar1pos = {x = 440, y = 669, z = 10},
     bossPosition = {x = 514, y = 162, z = 10},
     kickPosition = {x = 496, y = 168, z = 10},
     playerTeleport = {x = 514, y = 173, z = 10}
    }

    local gnome = Action()

    -- Start Script
    function gnome.onUse(creature, item, fromPosition, target, toPosition, isHotkey)

        if creature:getStorageValue(setting.storage) > os.time() then
        creature:sendCancelMessage("Necesitas esperar "..creature:getStorageValue(setting.storage) - os.time().." horas para volver a darle.")
        creature:getPosition():sendMagicEffect(CONST_ME_POFF)
        return true
        end


     if item.itemid == 1945 and item.actionid == 49131 then

     local clearOberonRoom = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)     
     for index, spectatorcheckface in ipairs(clearOberonRoom) do
     if spectatorcheckface:isPlayer() then
     creature:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Someone is fighting against the boss! You need wait awhile.")
     return false
     end
     end
     for index, removeOberon in ipairs(clearOberonRoom) do
     if (removeOberon:isMonster()) then
     removeOberon:remove()
     end
     end
     Game.createMonster("Lost Gnome", setting.bossPosition, false, true)
     Game.createMonster("", Position({x = setting.Pillar1pos.x, y = setting.Pillar1pos.y, z = setting.Pillar1pos.z}), false, true)

     
     local players = {}
     for i = 0, 0 do
     local player1 = Tile({x = (Position(item:getPosition()).x + 1) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
     local player2 = Tile({x = (Position(item:getPosition()).x + 2) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
     local player3 = Tile({x = (Position(item:getPosition()).x + 3) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
     local player4 = Tile({x = (Position(item:getPosition()).x + 4) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
     local player5 = Tile({x = (Position(item:getPosition()).x + 5) + i, y = Position(item:getPosition()).y + 0, z = Position(item:getPosition()).z}):getTopCreature()
     players[#players+1] = player1
     players[#players+1] = player2
     players[#players+1] = player3
     players[#players+1] = player4
     players[#players+1] = player5
     end
     for i, player in ipairs(players) do
     player:getPosition():sendMagicEffect(CONST_ME_POFF)
     player:teleportTo(Position(setting.playerTeleport), false)
     doSendMagicEffect(player:getPosition(), CONST_ME_TELEPORT)
     setPlayerStorageValue(player,setting.storage, os.time() + 10 * 60 * 60)
     player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have 10 minute(s) to to kill all respawn.')
     player:setStorageValue(setting.storage, os.time()+setting.exhausted_time * 60 * 60)
     addEvent(function()
     local spectatorsjivans = Game.getSpectators(Position(setting.centerRoom), false, false, 10, 10, 10, 10)
     for u = 1, #spectatorsjivans, 1 do
     if spectatorsjivans[u]:isPlayer() and (spectatorsjivans[u]:getName() == player:getName()) then
     player:teleportTo(Position(setting.kickPosition))
     player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
     player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Time is over.')
     end
     end
     end, 10 * 60 * 1000)
     end
     end
     return true
    end

    gnome:aid(49131)
    gnome:register()

    2 participantes

    3[Problema] exausted lever Empty Re: [Problema] exausted lever Sáb Jun 18, 2022 2:05 pm

    Dfsuno

    Dfsuno
    Miembro
    Miembro
    Very Happy Resuelto Gracias Very Happy

    2 participantes

    Contenido patrocinado


    2 participantes

    Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje (Página 1 de 1.)

    Permisos de este foro:
    No puedes responder a temas en este foro.

     

    BienvenidosTibiaFace es una comunidad de Open Tibia. Para participar debes estar registrado (click para Regístrate).