• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Epic Random Map

Vrotz

Member
Joined
Apr 7, 2011
Messages
1,071
Reaction score
7
Location
Brazil
How do I get a random map, but without necessarily pulling all players? All players who are coaches can not be moved. Because I have one, but it pulls all of the map and who is training is bad trip

EDIT: or else not teleport players that are in the arena map (I prefer this than the trainers).
 
Last edited:
just create a tp without editing the tp to pos, create an script to tp players and set it action id, add the action id to the tps.
In the script add a part for set storage, and edit a map changer just only for players storage > 1
:D
If nobody help you until I get back, I will do this.
 
well, as I promise.
>movements.xml
XML:
<movevent type="StepIn" actionid="1993;1994" event="script" value="tpconfig.lua"/>

>movements/tpconfig.lua
LUA:
local config = {
    tps = { 
        goto = {x = 1000, y = 1000, z = 7},
        back = {x = 1000, y = 1000, z = 8}
    },
    storage = 1993
    }
function onStepIn(cid, item, position, fromPosition)
    local pos = getCreaturePosition(cid)
    if item.actionid == config.storage then
    doTeleportThing(cid, config.tps.goto)
        setPlayerStorageValue(cid, config.storage, 1)
    elseif item.actionid == (config.storage + 1) then
        doTeleportThing(cid, config.tps.back)
        setPlayerStorageValue(cid, config.storage, 0)
    end
    doSendMagicEffect(position, CONST_ME_TELEPORT)
end

>globalevents.xml
XML:
<globalevent name="Map Change" interval="1200000" event="script" value="mapchanger.lua"/>

>globalevent/mapchanger.lua
LUA:
local config = {
    tpto = {x = 1000, y = 1000, z = 7},
    storage = 1993
    }
function onThink(interval, lastExecution, thinkInterval)
    for _, pid in ipairs(getPlayersOnline()) do
    if getPlayerStorageValue(pid, config.storage) ~= 1 then
            doTeleportThing(pid, config.tpto, false)
            doRemoveCondition(pid, CONDITION_INFIGHT)
            doCreatureAddHealth(pid, getCreatureMaxHealth(pid))
            doCreatureAddMana(pid, (getCreatureMaxMana(pid) - getCreatureMana(pid)))
            doBroadcastMessage("Map has been changed to MAP1! next map change will be in 20 minutes! have a nice fight!", MESSAGE_STATUS_WARNING)
    end
    end
    return true
end

The map changer is basic, I just add 1 position.
Also I edit the Bogart version and I can't add more thing cus I don't know what kind of server you have, but this should work.
 
Last edited:
well, the first script is a movement, you add a tp with the map editor and put it action id: 1993 for go to the trainers, and if you want to leave the trainers just create a tp with action id: 1994, change the positions goto and back for the pos to the trainers and the back to the city.
That script will give you storage 1993, and the map changer just will teleport the players who arent in the trainers zone
 
Back
Top