• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

RevScripts Boss room

dfs1

Member
Joined
Aug 27, 2011
Messages
75
Solutions
1
Reaction score
5
Good morning, could you help me with this script, it works correctly, only when you pull the lever from another position than in front and there are players inside the room, the boss erases them.

Lua:
local config = {
    leverUniqueID = 49210,
    requiredLevel = 110,
    daily = true,
    bossName = "rat",
    storage = 7777,
    roomCenterPosition = Position(577, 478, 5),
    playerPositions = {
        Position(580, 479, 6),
        Position(580, 478, 6),
        Position(580, 580, 6)
    },
    teleportPosition = Position(578, 479, 5),
    bossPosition = Position(577, 478, 5),

    kickMinutes = 15, -- minutes
    kickPosition = Position(503, 503, 7)
}

local rat = Action()

function rat.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item:getId() == 1945 then
        if player:getPosition() ~= config.playerPositions[1] then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Stand in front of the book..")
            return true
        end

        local participants = {}
        for _, playerPos in pairs(config.playerPositions) do
            local tile = Tile(playerPos)
            if tile then
                local participant = tile:getTopCreature()
                if participant and participant:isPlayer() then
                    if participant:getLevel() < config.requiredLevel then
                        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("All the players need to be level %d or higher.", config.requiredLevel))
                        return true
                    end

                    if config.daily and participant:getStorageValue(config.storage) > os.time() then
                        player:getPosition():sendMagicEffect(CONST_ME_POFF)
                        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Not all the players are ready yet since the last battle, they have to wait 1 hrs.")
                        return true
                    end

                    participants[#participants +1] = participant
                end
            end
        end

        for _, spectator in pairs(Game.getSpectators(config.roomCenterPosition, false, false, 5, 5, 5, 5)) do
            if spectator:isPlayer() then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "A team is already inside the boss room.")
                return true
            end
            spectator:remove()
        end

        local boss = Game.createMonster(config.bossName, config.bossPosition)
        if boss then boss:registerEvent("CancelKickEvent") end

        for _, participant in pairs(participants) do
            participant:getPosition():sendMagicEffect(CONST_ME_POFF)
            participant:teleportTo(config.teleportPosition)
            participant:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have 10 minute(s) to defeat the boss.')
            participant:setStorageValue(config.storage, os.time() + 0*60*60)
        end
        
        config.teleportPosition:sendMagicEffect(CONST_ME_ENERGYAREA)

        config.kickEventId = addEvent(function ()
            for _, spectator in pairs(Game.getSpectators(config.roomCenterPosition, false, false, 5, 5, 5, 5)) do
                if spectator:isPlayer() then
                    spectator:teleportTo(config.kickPosition, false)
                    spectator:sendTextMessage(MESSAGE_EVENT_ADVANCE,"Time is out!")
                else
                    spectator:remove()
                end
            end
            config.kickPosition:sendMagicEffect(CONST_ME_TELEPORT)
        end, config.kickMinutes * 1000 * 60)
    end

    item:transform(1945)
    return true
end

rat:uid(config.leverUniqueID)
rat:register()
 
OP
OP
dfs1

dfs1

Member
Joined
Aug 27, 2011
Messages
75
Solutions
1
Reaction score
5
when a player starts the boss room everything is correct, the problem is that when another player wants to enter the room and uses the lever when they are inside the room, the boss is deleted and the players are left without killing the boss.
 

mano368

Intermediate OT User
Joined
Sep 2, 2011
Messages
284
Solutions
34
Reaction score
116
Location
Brazil
I really don't know if gonna work, but give it a try

Lua:
local config = {
    leverUniqueID = 49210,
    requiredLevel = 110,
    daily = true,
    bossName = "rat",
    storage = 7777,
    roomCenterPosition = Position(577, 478, 5),
    playerPositions = {
        Position(580, 479, 6),
        Position(580, 478, 6),
        Position(580, 580, 6)
    },
    teleportPosition = Position(578, 479, 5),
    bossPosition = Position(577, 478, 5),

    kickMinutes = 15, -- minutes
    kickPosition = Position(503, 503, 7)
}

local rat = Action()

function rat.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item:getId() == 1945 then
        if player:getPosition() ~= config.playerPositions[1] then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Stand in front of the book..")
            return true
        end

        local spect = Game.getSpectators(config.roomCenterPosition, false, false, 5, 5, 5, 5)
        if spect:isPlayer() then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "A team is already inside the boss room.")
            return true
        end

        local participants = {}
        for _, playerPos in pairs(config.playerPositions) do
            local tile = Tile(playerPos)
            if tile then
                local participant = tile:getTopCreature()
                if participant and participant:isPlayer() then
                    if participant:getLevel() < config.requiredLevel then
                        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("All the players need to be level %d or higher.", config.requiredLevel))
                        return true
                    end

                    if config.daily and participant:getStorageValue(config.storage) > os.time() then
                        player:getPosition():sendMagicEffect(CONST_ME_POFF)
                        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Not all the players are ready yet since the last battle, they have to wait 1 hrs.")
                        return true
                    end

                    participants[#participants +1] = participant
                end
            end
        end

        local boss = Game.createMonster(config.bossName, config.bossPosition)
        if boss then boss:registerEvent("CancelKickEvent") end

        for _, participant in pairs(participants) do
            participant:getPosition():sendMagicEffect(CONST_ME_POFF)
            participant:teleportTo(config.teleportPosition)
            participant:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have 10 minute(s) to defeat the boss.')
            participant:setStorageValue(config.storage, os.time() + 0*60*60)
        end
        
        config.teleportPosition:sendMagicEffect(CONST_ME_ENERGYAREA)

        config.kickEventId = addEvent(function ()
            for _, spectator in pairs(Game.getSpectators(config.roomCenterPosition, false, false, 5, 5, 5, 5)) do
                if spectator:isPlayer() then
                    spectator:teleportTo(config.kickPosition, false)
                    spectator:sendTextMessage(MESSAGE_EVENT_ADVANCE,"Time is out!")
                else
                    spectator:remove()
                end
            end
            config.kickPosition:sendMagicEffect(CONST_ME_TELEPORT)
        end, config.kickMinutes * 1000 * 60)
    end

    item:transform(1945)
    return true
end

rat:uid(config.leverUniqueID)
rat:register()
 
OP
OP
dfs1

dfs1

Member
Joined
Aug 27, 2011
Messages
75
Solutions
1
Reaction score
5
now it does not delete it but when entering the room if they did not kill the boss 2 bosses come out.
 

mano368

Intermediate OT User
Joined
Sep 2, 2011
Messages
284
Solutions
34
Reaction score
116
Location
Brazil
Actually, I forgot that players can leave before 15 minutes, there are two ways, one is to put it so that until the 15 minutes have passed, no one enters, even if there is no one, and the other is to put it to remove the monsters if there is no player and so you can continue, so try again!

do two tests, 1 with only the boss inside and the other with the boss and a player at the same time

Lua:
local config = {
    leverUniqueID = 49210,
    requiredLevel = 110,
    daily = true,
    bossName = "rat",
    storage = 7777,
    roomCenterPosition = Position(577, 478, 5),
    playerPositions = {
        Position(580, 479, 6),
        Position(580, 478, 6),
        Position(580, 580, 6)
    },
    teleportPosition = Position(578, 479, 5),
    bossPosition = Position(577, 478, 5),

    kickMinutes = 15, -- minutes
    kickPosition = Position(503, 503, 7)
}

local rat = Action()

function rat.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item:getId() == 1945 then
        if player:getPosition() ~= config.playerPositions[1] then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Stand in front of the book..")
            return true
        end

        local spect = Game.getSpectators(config.roomCenterPosition, false, false, 5, 5, 5, 5)
        if spect:isPlayer() then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "A team is already inside the boss room. Wait until the end of the fight.")
            return true
        end

        if spect:isMonster() then
            spect:remove()
        end

        local participants = {}
        for _, playerPos in pairs(config.playerPositions) do
            local tile = Tile(playerPos)
            if tile then
                local participant = tile:getTopCreature()
                if participant and participant:isPlayer() then
                    if participant:getLevel() < config.requiredLevel then
                        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("All the players need to be level %d or higher.", config.requiredLevel))
                        return true
                    end

                    if config.daily and participant:getStorageValue(config.storage) > os.time() then
                        player:getPosition():sendMagicEffect(CONST_ME_POFF)
                        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Not all the players are ready yet since the last battle, they have to wait 1 hrs.")
                        return true
                    end

                    participants[#participants +1] = participant
                end
            end
        end

        local boss = Game.createMonster(config.bossName, config.bossPosition)
        if boss then boss:registerEvent("CancelKickEvent") end

        for _, participant in pairs(participants) do
            participant:getPosition():sendMagicEffect(CONST_ME_POFF)
            participant:teleportTo(config.teleportPosition)
            participant:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have 10 minute(s) to defeat the boss.')
            participant:setStorageValue(config.storage, os.time() + 0*60*60)
        end
       
        config.teleportPosition:sendMagicEffect(CONST_ME_ENERGYAREA)

        config.kickEventId = addEvent(function ()
            for _, spectator in pairs(Game.getSpectators(config.roomCenterPosition, false, false, 5, 5, 5, 5)) do
                if spectator:isPlayer() then
                    spectator:teleportTo(config.kickPosition, false)
                    spectator:sendTextMessage(MESSAGE_EVENT_ADVANCE,"Time is out!")
                else
                    spectator:remove()
                end
            end
            config.kickPosition:sendMagicEffect(CONST_ME_TELEPORT)
        end, config.kickMinutes * 1000 * 60)
    end

    item:transform(1945)
    return true
end

rat:uid(config.leverUniqueID)
rat:register()
 
OP
OP
dfs1

dfs1

Member
Joined
Aug 27, 2011
Messages
75
Solutions
1
Reaction score
5
It doesn't work

[C]: in function '__newindex'
...nt\data\scripts\actions\bosses\gnome.lua:24: in main chunk
[C]: in function 'reload'
 

mano368

Intermediate OT User
Joined
Sep 2, 2011
Messages
284
Solutions
34
Reaction score
116
Location
Brazil
Change line 29 to 37 for:

Lua:
        for _, spec in pairs(Game.getSpectators(config.roomCenterPosition, false, false, 5, 5, 5, 5)) do
            if spec:isPlayer() then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "A team is already inside the boss room.")
                return true
            else
               spec:remove()
            end
        end
 

Alberto Cabrera

Well-Known Member
Joined
Sep 17, 2020
Messages
75
Solutions
17
Reaction score
72
Location
México
Lua:
local config = {
    leverUniqueID = 49210,
    requiredLevel = 110,
    daily = true,
    bossName = "rat",
    storage = 7777,
    roomCenterPosition = Position(577, 478, 5),
    playerPositions = {
        Position(580, 479, 6),
        Position(580, 478, 6),
        Position(580, 580, 6)
    },
    teleportPosition = Position(578, 479, 5),
    bossPosition = Position(577, 478, 5),

    kickMinutes = 15, -- minutes
    kickPosition = Position(503, 503, 7)
}

local rat = Action()

function rat.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item:getId() == 1945 then
        if player:getPosition() ~= config.playerPositions[1] then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Stand in front of the book..")
            return true
        end

        for _, spectator in pairs(Game.getSpectators(config.roomCenterPosition, false, false, 5, 5, 5, 5)) do
            if spectator:isPlayer() then
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "A team is already inside the boss room.")
                return true
            end
            spectator:remove()
        end

        local participants = {}
        for _, playerPos in pairs(config.playerPositions) do
            local tile = Tile(playerPos)
            if tile then
                local participant = tile:getTopCreature()
                if participant and participant:isPlayer() then
                    if participant:getLevel() < config.requiredLevel then
                        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("All the players need to be level %d or higher.", config.requiredLevel))
                        return true
                    end

                    if config.daily and participant:getStorageValue(config.storage) > os.time() then
                        player:getPosition():sendMagicEffect(CONST_ME_POFF)
                        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Not all the players are ready yet since the last battle, they have to wait 1 hrs.")
                        return true
                    end

                    participants[#participants +1] = participant
                end
            end
        end

        local boss = Game.createMonster(config.bossName, config.bossPosition)
        if boss then boss:registerEvent("CancelKickEvent") end

        for _, participant in pairs(participants) do
            participant:getPosition():sendMagicEffect(CONST_ME_POFF)
            participant:teleportTo(config.teleportPosition)
            participant:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You have 10 minute(s) to defeat the boss.')
            participant:setStorageValue(config.storage, os.time() + 0*60*60)
        end
        
        config.teleportPosition:sendMagicEffect(CONST_ME_ENERGYAREA)

        config.kickEventId = addEvent(function ()
            for _, spectator in pairs(Game.getSpectators(config.roomCenterPosition, false, false, 5, 5, 5, 5)) do
                if spectator:isPlayer() then
                    spectator:teleportTo(config.kickPosition, false)
                    spectator:sendTextMessage(MESSAGE_EVENT_ADVANCE,"Time is out!")
                else
                    spectator:remove()
                end
            end
            config.kickPosition:sendMagicEffect(CONST_ME_TELEPORT)
        end, config.kickMinutes * 1000 * 60)
    end

    item:transform(1945)
    return true
end

rat:uid(config.leverUniqueID)
rat:register()
 
OP
OP
dfs1

dfs1

Member
Joined
Aug 27, 2011
Messages
75
Solutions
1
Reaction score
5
I give up on that script, it keeps deleting the boss, could you help me put a timeout on this script to use the lever again?


Lua:
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()
 

VagosClubTM

Member
Joined
Aug 16, 2019
Messages
176
Reaction score
23
Location
Chile
I give up on that script, it keeps deleting the boss, could you help me put a timeout on this script to use the lever again?


Lua:
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()
hello friend I'm eating use this script for what to search I use it and I have more than 20 rooms

BOSS ROOM BY SARAH WESKER
 
OP
OP
dfs1

dfs1

Member
Joined
Aug 27, 2011
Messages
75
Solutions
1
Reaction score
5

VagosClubTM

has a problem the items need to be complete, I need from 1 to 5 players


Could you please help me with the boss lever, pulling the lever gives the player exhausted to use it again, everything working that part the problem is that if another player who is not exhausted pulls and the player who is exhausted is behind him He goes into the room again.


Lua:
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()
Captura.PNG
 
Last edited:
Top