• 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!

Lua do not allow the same ip for the boss (MC)

darkmu

Active Member
Joined
Aug 26, 2007
Messages
249
Solutions
1
Reaction score
44
Location
Paraná,Brazil
I would like to put a validation if someone is with MC, he does not allow

TFS 1.3

Lua:
local config = {
    requiredLevel = 250,
    daily = false,
    BossPosition = Position(423, 581, 15),
    centerDemonRoomPosition = Position(423, 583, 15),
    playerPositions = {
        Position(454, 581, 15),
        Position(454, 582, 15),
        Position(454, 583, 15),
        Position(454, 584, 15),
        Position(454, 585, 15)

    },
    newPositions = {
        Position(424, 589, 15), -- Posição dos players 1,2,3,4,5
        Position(424, 589, 15),
        Position(424, 589, 15),
        Position(424, 589, 15),
        Position(424, 589, 15)
    },
}

function onUse(player, item, fromPosition, target, toPosition, monster, isHotkey)
    if item.itemid == 9825 then
        if player:getPosition() ~= Position(454, 581, 15) then
            item:transform(9826)
            return true
        end           
    
        local storePlayers, playerTile = {}
        local exaustedSeconds = 1
        for i = 1, #config.playerPositions do
            playerTile = Tile(config.playerPositions[i]):getTopCreature()
            if not (player:getStorageValue(37869) <= os.time()) then
                player:say(string.format("You did this boss before %i hours.", player:isVip() == true and 8 or 12), TALKTYPE_MONSTER_SAY)
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Someone already did this room!")
                return true           
            end
            storePlayers[#storePlayers + 1] = playerTile
        end
                
        local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]           
            if spec:isPlayer() then
                if item.itemid == 9826 then
                    if player:getPosition() ~= Position(454, 580, 15) then
                        item:transform(9826)
                        player:say("Someone is fighting with Alptramun.", TALKTYPE_MONSTER_SAY)
                        return true
                    end
                end
                return true
            end
        end       

        local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]
            if spec:isPlayer() then
                player:say("Someone is fighting with Alptramun.", TALKTYPE_MONSTER_SAY)
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Someone is fighting with Alptramun.")
                return true
            end

            spec:remove()
        end
    
        local players
        local monster = Game.createMonster("Alptramun", Position(423, 581, 15))
        
        if monster then
            monster:setReward(true)
        end
        
        for i = 1, #storePlayers do
            players = storePlayers[i]
        
            if not (players:getStorageValue(37869) <= os.time()) then
                players:sendTextMessage(TALKTYPE_MONSTER_SAY, string.format("You did this boss before %i hours.", player:isVip() == true and 8 or 12))
                player:say("Someone already did this room!", TALKTYPE_MONSTER_SAY)
                return
            end
        end
        
        for i = 1, #storePlayers do
            players = storePlayers[i]
            
            config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF)
            players:teleportTo(config.newPositions[i])
            config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA)
            players:setDirection(DIRECTION_NORTH)
            players:say('Seu time tem 15 minutos para matar o boss. Caso ao contrario serao kikados da sala e perdera a chance !!.', TALKTYPE_MONSTER_SAY)
            
            if not players:isMonster() then
                if players:isVip() then
                    players:setStorageValue(37869, os.time()+exaustedSeconds*28800)
                else
                    players:setStorageValue(37869, os.time()+exaustedSeconds*43200)
                end
            end                   
        end
        
        addEvent(cleanRoom, 15 * 60 * 1000, config.centerDemonRoomPosition, 15, 15)
        elseif item.itemid == 9825 then
            if config.daily then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
                return true
            end
        end

    item:transform(item.itemid == 9826 and 9825 or 9826)
    return true
end
 

Ascuas Funkeln

Rakkedo Game
Joined
Apr 14, 2013
Messages
515
Solutions
30
Reaction score
267
Location
Poland
GitHub
AscuasFunkeln
I would like to put a validation if someone is with MC, he does not allow

TFS 1.3

Lua:
local config = {
    requiredLevel = 250,
    daily = false,
    BossPosition = Position(423, 581, 15),
    centerDemonRoomPosition = Position(423, 583, 15),
    playerPositions = {
        Position(454, 581, 15),
        Position(454, 582, 15),
        Position(454, 583, 15),
        Position(454, 584, 15),
        Position(454, 585, 15)

    },
    newPositions = {
        Position(424, 589, 15), -- Posição dos players 1,2,3,4,5
        Position(424, 589, 15),
        Position(424, 589, 15),
        Position(424, 589, 15),
        Position(424, 589, 15)
    },
}

function onUse(player, item, fromPosition, target, toPosition, monster, isHotkey)
    if item.itemid == 9825 then
        if player:getPosition() ~= Position(454, 581, 15) then
            item:transform(9826)
            return true
        end          
   
        local storePlayers, playerTile = {}
        local exaustedSeconds = 1
        for i = 1, #config.playerPositions do
            playerTile = Tile(config.playerPositions[i]):getTopCreature()
            if not (player:getStorageValue(37869) <= os.time()) then
                player:say(string.format("You did this boss before %i hours.", player:isVip() == true and 8 or 12), TALKTYPE_MONSTER_SAY)
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Someone already did this room!")
                return true          
            end
            storePlayers[#storePlayers + 1] = playerTile
        end
               
        local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]          
            if spec:isPlayer() then
                if item.itemid == 9826 then
                    if player:getPosition() ~= Position(454, 580, 15) then
                        item:transform(9826)
                        player:say("Someone is fighting with Alptramun.", TALKTYPE_MONSTER_SAY)
                        return true
                    end
                end
                return true
            end
        end      

        local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]
            if spec:isPlayer() then
                player:say("Someone is fighting with Alptramun.", TALKTYPE_MONSTER_SAY)
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Someone is fighting with Alptramun.")
                return true
            end

            spec:remove()
        end
   
        local players
        local monster = Game.createMonster("Alptramun", Position(423, 581, 15))
       
        if monster then
            monster:setReward(true)
        end
       
        for i = 1, #storePlayers do
            players = storePlayers[i]
       
            if not (players:getStorageValue(37869) <= os.time()) then
                players:sendTextMessage(TALKTYPE_MONSTER_SAY, string.format("You did this boss before %i hours.", player:isVip() == true and 8 or 12))
                player:say("Someone already did this room!", TALKTYPE_MONSTER_SAY)
                return
            end
        end
       
        for i = 1, #storePlayers do
            players = storePlayers[i]
           
            config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF)
            players:teleportTo(config.newPositions[i])
            config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA)
            players:setDirection(DIRECTION_NORTH)
            players:say('Seu time tem 15 minutos para matar o boss. Caso ao contrario serao kikados da sala e perdera a chance !!.', TALKTYPE_MONSTER_SAY)
           
            if not players:isMonster() then
                if players:isVip() then
                    players:setStorageValue(37869, os.time()+exaustedSeconds*28800)
                else
                    players:setStorageValue(37869, os.time()+exaustedSeconds*43200)
                end
            end                  
        end
       
        addEvent(cleanRoom, 15 * 60 * 1000, config.centerDemonRoomPosition, 15, 15)
        elseif item.itemid == 9825 then
            if config.daily then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
                return true
            end
        end

    item:transform(item.itemid == 9826 and 9825 or 9826)
    return true
end
Lua:
function onUse(player, item, fromPosition, target, toPosition, monster, isHotkey)
local PlayerPerIP = 1
local MC = 0
    for _, check in ipairs(Game.getPlayers()) do
        if player:getIp() == check:getIp() then
            MC = MC + 1
            if MC > PlayerPerIP then
                return false
            end
        end
    end

    if item.itemid == 9825 then
        if player:getPosition() ~= Position(454, 581, 15) then
            item:transform(9826)
            return true
        end           
    
        local storePlayers, playerTile = {}
        local exaustedSeconds = 1
        for i = 1, #config.playerPositions do
            playerTile = Tile(config.playerPositions[i]):getTopCreature()
            if not (player:getStorageValue(37869) <= os.time()) then
                player:say(string.format("You did this boss before %i hours.", player:isVip() == true and 8 or 12), TALKTYPE_MONSTER_SAY)
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Someone already did this room!")
                return true           
            end
            storePlayers[#storePlayers + 1] = playerTile
        end
                
        local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]           
            if spec:isPlayer() then
                if item.itemid == 9826 then
                    if player:getPosition() ~= Position(454, 580, 15) then
                        item:transform(9826)
                        player:say("Someone is fighting with Alptramun.", TALKTYPE_MONSTER_SAY)
                        return true
                    end
                end
                return true
            end
        end       

        local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]
            if spec:isPlayer() then
                player:say("Someone is fighting with Alptramun.", TALKTYPE_MONSTER_SAY)
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Someone is fighting with Alptramun.")
                return true
            end

            spec:remove()
        end
    
        local players
        local monster = Game.createMonster("Alptramun", Position(423, 581, 15))
        
        if monster then
            monster:setReward(true)
        end
        
        for i = 1, #storePlayers do
            players = storePlayers[i]
        
            if not (players:getStorageValue(37869) <= os.time()) then
                players:sendTextMessage(TALKTYPE_MONSTER_SAY, string.format("You did this boss before %i hours.", player:isVip() == true and 8 or 12))
                player:say("Someone already did this room!", TALKTYPE_MONSTER_SAY)
                return
            end
        end
        
        for i = 1, #storePlayers do
            players = storePlayers[i]
            
            config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF)
            players:teleportTo(config.newPositions[i])
            config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA)
            players:setDirection(DIRECTION_NORTH)
            players:say('Seu time tem 15 minutos para matar o boss. Caso ao contrario serao kikados da sala e perdera a chance !!.', TALKTYPE_MONSTER_SAY)
            
            if not players:isMonster() then
                if players:isVip() then
                    players:setStorageValue(37869, os.time()+exaustedSeconds*28800)
                else
                    players:setStorageValue(37869, os.time()+exaustedSeconds*43200)
                end
            end                   
        end
        
        addEvent(cleanRoom, 15 * 60 * 1000, config.centerDemonRoomPosition, 15, 15)
        elseif item.itemid == 9825 then
            if config.daily then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
                return true
            end
        end

    item:transform(item.itemid == 9826 and 9825 or 9826)
    return true
end
 
OP
OP
darkmu

darkmu

Active Member
Joined
Aug 26, 2007
Messages
249
Solutions
1
Reaction score
44
Location
Paraná,Brazil
Lua:
function onUse(player, item, fromPosition, target, toPosition, monster, isHotkey)
local PlayerPerIP = 1
local MC = 0
    for _, check in ipairs(Game.getPlayers()) do
        if player:getIp() == check:getIp() then
            MC = MC + 1
            if MC > PlayerPerIP then
                return false
            end
        end
    end

    if item.itemid == 9825 then
        if player:getPosition() ~= Position(454, 581, 15) then
            item:transform(9826)
            return true
        end          
   
        local storePlayers, playerTile = {}
        local exaustedSeconds = 1
        for i = 1, #config.playerPositions do
            playerTile = Tile(config.playerPositions[i]):getTopCreature()
            if not (player:getStorageValue(37869) <= os.time()) then
                player:say(string.format("You did this boss before %i hours.", player:isVip() == true and 8 or 12), TALKTYPE_MONSTER_SAY)
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Someone already did this room!")
                return true          
            end
            storePlayers[#storePlayers + 1] = playerTile
        end
               
        local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]          
            if spec:isPlayer() then
                if item.itemid == 9826 then
                    if player:getPosition() ~= Position(454, 580, 15) then
                        item:transform(9826)
                        player:say("Someone is fighting with Alptramun.", TALKTYPE_MONSTER_SAY)
                        return true
                    end
                end
                return true
            end
        end      

        local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]
            if spec:isPlayer() then
                player:say("Someone is fighting with Alptramun.", TALKTYPE_MONSTER_SAY)
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Someone is fighting with Alptramun.")
                return true
            end

            spec:remove()
        end
   
        local players
        local monster = Game.createMonster("Alptramun", Position(423, 581, 15))
       
        if monster then
            monster:setReward(true)
        end
       
        for i = 1, #storePlayers do
            players = storePlayers[i]
       
            if not (players:getStorageValue(37869) <= os.time()) then
                players:sendTextMessage(TALKTYPE_MONSTER_SAY, string.format("You did this boss before %i hours.", player:isVip() == true and 8 or 12))
                player:say("Someone already did this room!", TALKTYPE_MONSTER_SAY)
                return
            end
        end
       
        for i = 1, #storePlayers do
            players = storePlayers[i]
           
            config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF)
            players:teleportTo(config.newPositions[i])
            config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA)
            players:setDirection(DIRECTION_NORTH)
            players:say('Seu time tem 15 minutos para matar o boss. Caso ao contrario serao kikados da sala e perdera a chance !!.', TALKTYPE_MONSTER_SAY)
           
            if not players:isMonster() then
                if players:isVip() then
                    players:setStorageValue(37869, os.time()+exaustedSeconds*28800)
                else
                    players:setStorageValue(37869, os.time()+exaustedSeconds*43200)
                end
            end                  
        end
       
        addEvent(cleanRoom, 15 * 60 * 1000, config.centerDemonRoomPosition, 15, 15)
        elseif item.itemid == 9825 then
            if config.daily then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
                return true
            end
        end

    item:transform(item.itemid == 9826 and 9825 or 9826)
    return true
end

The problem in the code is that the verification is global, in my case the verification of ips should be only among the people who will be on the floor .. checking the ip and blocking from killing the boss.
 

Ascuas Funkeln

Rakkedo Game
Joined
Apr 14, 2013
Messages
515
Solutions
30
Reaction score
267
Location
Poland
GitHub
AscuasFunkeln
The problem in the code is that the verification is global, in my case the verification of ips should be only among the people who will be on the floor .. checking the ip and blocking from killing the boss.
Check this, and change "from, to" position to your room position
Lua:
function onUse(player, item, fromPosition, target, toPosition, monster, isHotkey)
    local from = {x = 981, y = 997, z = 10}
    local to = {x = 1002, y = 1017, z = 10}
    local pos = {x = 992, y = 1008, z = 10}
    for x = from.x, to.x do
        for y = from.y, to.y do
            for z = from.z, to.z do
                pos2 = {x = x, y = y, z = z, stackpos = 253}
                v = getThingfromPos(pos2).uid
                if isPlayer(v) then
local PlayerPerIP = 1
local MC = 0
    for _, check in ipairs(v) do
        if player:getIp() == check:getIp() then
            MC = MC + 1
            if MC > PlayerPerIP then
                return false
            end
        end
    end
    end
        end
            end
                end

local PlayerPerIP = 1
local MC = 0
    for _, check in ipairs(Game.getPlayers()) do
        if player:getIp() == check:getIp() then
            MC = MC + 1
            if MC > PlayerPerIP then
                return false
            end
        end
    end

    if item.itemid == 9825 then
        if player:getPosition() ~= Position(454, 581, 15) then
            item:transform(9826)
            return true
        end           
    
        local storePlayers, playerTile = {}
        local exaustedSeconds = 1
        for i = 1, #config.playerPositions do
            playerTile = Tile(config.playerPositions[i]):getTopCreature()
            if not (player:getStorageValue(37869) <= os.time()) then
                player:say(string.format("You did this boss before %i hours.", player:isVip() == true and 8 or 12), TALKTYPE_MONSTER_SAY)
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Someone already did this room!")
                return true           
            end
            storePlayers[#storePlayers + 1] = playerTile
        end
                
        local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]           
            if spec:isPlayer() then
                if item.itemid == 9826 then
                    if player:getPosition() ~= Position(454, 580, 15) then
                        item:transform(9826)
                        player:say("Someone is fighting with Alptramun.", TALKTYPE_MONSTER_SAY)
                        return true
                    end
                end
                return true
            end
        end       

        local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]
            if spec:isPlayer() then
                player:say("Someone is fighting with Alptramun.", TALKTYPE_MONSTER_SAY)
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Someone is fighting with Alptramun.")
                return true
            end

            spec:remove()
        end
    
        local players
        local monster = Game.createMonster("Alptramun", Position(423, 581, 15))
        
        if monster then
            monster:setReward(true)
        end
        
        for i = 1, #storePlayers do
            players = storePlayers[i]
        
            if not (players:getStorageValue(37869) <= os.time()) then
                players:sendTextMessage(TALKTYPE_MONSTER_SAY, string.format("You did this boss before %i hours.", player:isVip() == true and 8 or 12))
                player:say("Someone already did this room!", TALKTYPE_MONSTER_SAY)
                return
            end
        end
        
        for i = 1, #storePlayers do
            players = storePlayers[i]
            
            config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF)
            players:teleportTo(config.newPositions[i])
            config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA)
            players:setDirection(DIRECTION_NORTH)
            players:say('Seu time tem 15 minutos para matar o boss. Caso ao contrario serao kikados da sala e perdera a chance !!.', TALKTYPE_MONSTER_SAY)
            
            if not players:isMonster() then
                if players:isVip() then
                    players:setStorageValue(37869, os.time()+exaustedSeconds*28800)
                else
                    players:setStorageValue(37869, os.time()+exaustedSeconds*43200)
                end
            end                   
        end
        
        addEvent(cleanRoom, 15 * 60 * 1000, config.centerDemonRoomPosition, 15, 15)
        elseif item.itemid == 9825 then
            if config.daily then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
                return true
            end
        end

    item:transform(item.itemid == 9826 and 9825 or 9826)
    return true
end
 
OP
OP
darkmu

darkmu

Active Member
Joined
Aug 26, 2007
Messages
249
Solutions
1
Reaction score
44
Location
Paraná,Brazil
Check this, and change "from, to" position to your room position
Lua:
function onUse(player, item, fromPosition, target, toPosition, monster, isHotkey)
    local from = {x = 981, y = 997, z = 10}
    local to = {x = 1002, y = 1017, z = 10}
    local pos = {x = 992, y = 1008, z = 10}
    for x = from.x, to.x do
        for y = from.y, to.y do
            for z = from.z, to.z do
                pos2 = {x = x, y = y, z = z, stackpos = 253}
                v = getThingfromPos(pos2).uid
                if isPlayer(v) then
local PlayerPerIP = 1
local MC = 0
    for _, check in ipairs(v) do
        if player:getIp() == check:getIp() then
            MC = MC + 1
            if MC > PlayerPerIP then
                return false
            end
        end
    end
    end
        end
            end
                end

local PlayerPerIP = 1
local MC = 0
    for _, check in ipairs(Game.getPlayers()) do
        if player:getIp() == check:getIp() then
            MC = MC + 1
            if MC > PlayerPerIP then
                return false
            end
        end
    end

    if item.itemid == 9825 then
        if player:getPosition() ~= Position(454, 581, 15) then
            item:transform(9826)
            return true
        end          
   
        local storePlayers, playerTile = {}
        local exaustedSeconds = 1
        for i = 1, #config.playerPositions do
            playerTile = Tile(config.playerPositions[i]):getTopCreature()
            if not (player:getStorageValue(37869) <= os.time()) then
                player:say(string.format("You did this boss before %i hours.", player:isVip() == true and 8 or 12), TALKTYPE_MONSTER_SAY)
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Someone already did this room!")
                return true          
            end
            storePlayers[#storePlayers + 1] = playerTile
        end
               
        local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]          
            if spec:isPlayer() then
                if item.itemid == 9826 then
                    if player:getPosition() ~= Position(454, 580, 15) then
                        item:transform(9826)
                        player:say("Someone is fighting with Alptramun.", TALKTYPE_MONSTER_SAY)
                        return true
                    end
                end
                return true
            end
        end      

        local specs, spec = Game.getSpectators(config.centerDemonRoomPosition, false, false, 15, 15, 15, 15)
        for i = 1, #specs do
            spec = specs[i]
            if spec:isPlayer() then
                player:say("Someone is fighting with Alptramun.", TALKTYPE_MONSTER_SAY)
                player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Someone is fighting with Alptramun.")
                return true
            end

            spec:remove()
        end
   
        local players
        local monster = Game.createMonster("Alptramun", Position(423, 581, 15))
       
        if monster then
            monster:setReward(true)
        end
       
        for i = 1, #storePlayers do
            players = storePlayers[i]
       
            if not (players:getStorageValue(37869) <= os.time()) then
                players:sendTextMessage(TALKTYPE_MONSTER_SAY, string.format("You did this boss before %i hours.", player:isVip() == true and 8 or 12))
                player:say("Someone already did this room!", TALKTYPE_MONSTER_SAY)
                return
            end
        end
       
        for i = 1, #storePlayers do
            players = storePlayers[i]
           
            config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF)
            players:teleportTo(config.newPositions[i])
            config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA)
            players:setDirection(DIRECTION_NORTH)
            players:say('Seu time tem 15 minutos para matar o boss. Caso ao contrario serao kikados da sala e perdera a chance !!.', TALKTYPE_MONSTER_SAY)
           
            if not players:isMonster() then
                if players:isVip() then
                    players:setStorageValue(37869, os.time()+exaustedSeconds*28800)
                else
                    players:setStorageValue(37869, os.time()+exaustedSeconds*43200)
                end
            end                  
        end
       
        addEvent(cleanRoom, 15 * 60 * 1000, config.centerDemonRoomPosition, 15, 15)
        elseif item.itemid == 9825 then
            if config.daily then
                player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
                return true
            end
        end

    item:transform(item.itemid == 9826 and 9825 or 9826)
    return true
end
will there be a function that we can go through a table and check if there are 2 or more ip equal and return true?
 

kubernik

Active Member
Joined
Jul 4, 2014
Messages
85
Solutions
7
Reaction score
29
Code:
local checkMc = {}
for i = 1, #config.playerPositions do
            playerTile = Tile(config.playerPositions[i]):getTopCreature()
local getIp = playerTile:getIp()
if checkMc[getIp] == true then
return false -- here is someone with mc
end
checkMc[getIp] = true
end

Write on phone.. so.. xd
 
Top