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

move all players

leandroluck

New Member
Joined
Dec 24, 2010
Messages
104
Reaction score
1
Code:
function onThink(interval, lastExecution)
    if string.lower(rotateMaps) ~= "yes" then
        return true
    end
    local players = Game.getPlayers()
    local currentTemple = Game.getStorageValue(currentMap)
    if #players == 0 then
        return true
    end
    if currentTemple == numberOfMaps then
        Game.setStorageValue(currentMap, 1)
        else
        Game.setStorageValue(currentMap, Game.getStorageValue(currentMap) + 1)
    end
    for i = 1, #players do
        local newTemple = Game.getStorageValue(currentMap)
        local pos, player = mapPositions[newTemple]
        player = players[i]
        player:teleportTo(pos)
        player:addHealth(player:getMaxHealth())
        player:addMana(player:getMaxMana())
        local tmp = {CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY, CONDITION_BLEEDING, CONDITION_PARALYZE, CONDITION_INVISIBLE, CONDITION_MANASHIELD, CONDITION_INFIGHT, CONDITION_DRUNK, CONDITION_DROWN, CONDITION_ATTRIBUTES, CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED, CONDITION_PACIFIED, CONDITION_SPELLCOOLDOWN, CONDITION_SPELLGROUPCOOLDOWN}
        for i = 1, #tmp do
            player:removeCondition(tmp[i])
        end
        player:sendTextMessage(MESSAGE_STATUS_WARNING, mapChangeText)
    end
    return true
end
 
Last edited:
Code:
function onThink(interval, lastExecution)
    if string.lower(rotateMaps) ~= "yes" then
        return true
    end
    local players = Game.getPlayers()
    local currentTemple = Game.getStorageValue(currentMap)
    if #players == 0 then
        return true
    end
    if currentTemple == numberOfMaps then
        Game.setStorageValue(currentMap, 1)
        else
        Game.setStorageValue(currentMap, Game.getStorageValue(currentMap) + 1)
    end
    for i = 1, #players do
        local newTemple = Game.getStorageValue(currentMap)
        local pos, player = mapPositions[newTemple]
        player = players[i]
        if player:getLevel() > 8 then
          player:teleportTo(pos)
          player:addHealth(player:getMaxHealth())
          player:addMana(player:getMaxMana())
          local tmp = {CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY, CONDITION_BLEEDING, CONDITION_PARALYZE, CONDITION_INVISIBLE, CONDITION_MANASHIELD, CONDITION_INFIGHT, CONDITION_DRUNK, CONDITION_DROWN, CONDITION_ATTRIBUTES, CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED, CONDITION_PACIFIED, CONDITION_SPELLCOOLDOWN, CONDITION_SPELLGROUPCOOLDOWN}
          for i = 1, #tmp do
              player:removeCondition(tmp[i])
          end
          player:sendTextMessage(MESSAGE_STATUS_WARNING, mapChangeText)
        end
    end
    return true
end
 
Back
Top