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

Portal Random Location

Candlejack

Don't hug me I'm scared
Joined
Jun 20, 2012
Messages
87
Reaction score
38
Location
nowhere
I want to make a single portal that can teleport to up to 13 locations. When you enter the portal it would randomly select which one of the 13 locations to send you to. Is this possible?
 
This works out well for me as well, since I can probably use this 'somewhere'. xD

Created and tested on
The Forgotten Server, version 0.3.7_SVN (Crying Damson)

Your welcome, and oddly enough, thank you.

movements.xml
Code:
<movevent type="StepIn" actionid="45158" event="script" value="randomteleport.lua"/>
data/movements/scripts/
randomteleport.lua
Code:
local ids = {
  [1] = {x = 1562, y = 1497, z = 8},
  [2] = {x = 1563, y = 1497, z = 8},
  [3] = {x = 1565, y = 1497, z = 8},
  [4] = {x = 1566, y = 1497, z = 8},
  [5] = {x = 1562, y = 1498, z = 8},
  [6] = {x = 1563, y = 1498, z = 8},
  [7] = {x = 1565, y = 1498, z = 8},
  [8] = {x = 1566, y = 1498, z = 8},
  [9] = {x = 1562, y = 1500, z = 8},
  [10] = {x = 1563, y = 1500, z = 8},
  [11] = {x = 1565, y = 1500, z = 8},
  [12] = {x = 1566, y = 1500, z = 8},
  [13] = {x = 1562, y = 1501, z = 8},
  [14] = {x = 1563, y = 1501, z = 8},
  [15] = {x = 1565, y = 1501, z = 8},
  [16] = {x = 1566, y = 1501, z = 8}
}

function onStepIn(cid, item, fromPos, item2, toPos)
  local rand = ids[math.random(#ids)]
     local randomlocation = doTeleportThing(cid, rand)
  return true
end

Xikini
 
Back
Top Bottom