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

Need Random Script

Ok, in your map editor add a portal without destination.
Add to this portal action id(for example 2121).

In movements.xml
Code:
<movevent type="StepIn" actionid="2121" event="script" value="tp.lua"/>

movements/scripts/tp.lua
LUA:
function onStepIn(cid, item, pos, frompos) 
first = {x=997, y=997, z=7}
second = {x=1000, y=1005, z=7}
third = {x=1000, y=1000, z=8}
fourth = {x=1001, y=1000, z=7}
local place = {first, second, third, fourth}
local dest = place[math.random(1, #place)]
doTeleportThing(cid, dest, TRUE)
  end
Just change your positions :D
[Tested on TFS 0.3.6]
 
LUA:
local first, second, third, fourth = {x=997, y=997, z=7}, {x=1000, y=1005, z=7}, {x=1000, y=1000, z=8}, {x=1001, y=1000, z=7}
 
Code:
local places = {
	{x=997, y=997, z=7},
	{x=1000, y=1005, z=7},
	{x=1000, y=1000, z=8},
	{x=1001, y=1000, z=7}
}
function onStepIn(cid, item, position, fromPosition)
	doTeleportThing(cid, places[math.random(#places)])
end
 
Back
Top