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

Linux Random Script Map

Vrotz

Member
Joined
Apr 7, 2011
Messages
1,071
Reaction score
7
Location
Brazil
Hello,

I'm searching for an script for random map and find that, but i dont understand certain what the thread said and I need a help.

The script is:
PHP:
local config, new = { minTownId = 1, maxTownId = 4 }, 0 function onThink(interval, lastExecution) 
 for _, pid in ipairs(getPlayersOnline()) do local town = getPlayerTown(pid) 
 new = town < config.maxTownId and town + 1 or config.minTownId 
 doPlayerSetTown(pid, new) doTeleportThing(pid, getTownTemplePosition(new)) end 
 db.executeQuery("UPDATE players SET town_id = ".. new ..", posx = 0, posy = 0, posz = 0;") 
 return true 
end

How I do to configure more three towns? How the script need be?
 
Well you make 4 different "maps" inside the map editor in the same map all with different temple ids from 1-4 and depending on when you want to use this script you spawn on a different temple pos i.e. "new" map thats how the script works atleast.

For a map where for example the towns has the temple id of
1. Thais
2. Venore
3. Carlin
4. Ab'dendriel
They would be spawned on one of those positions and had their hometown changed to that town each time this script is executed so if you would seperate these towns so that they were out of a reach from eachother that could be concidered "another map"
 
Well you make 4 different "maps" inside the map editor in the same map all with different temple ids from 1-4 and depending on when you want to use this script you spawn on a different temple pos i.e. "new" map thats how the script works atleast.

For a map where for example the towns has the temple id of
1. Thais
2. Venore
3. Carlin
4. Ab'dendriel
They would be spawned on one of those positions and had their hometown changed to that town each time this script is executed so if you would seperate these towns so that they were out of a reach from eachother that could be concidered "another map"

Many thanks brother.
 
Back
Top