for does that may have interest in how I end up dooing it here it is.
I used teleporter in checker formation. This was combined with 4 timers (2 for activating the 2 function of the script and 2 to deactivate the teleporter) all in sequence.
Code: Select all
-- challenge were the player has too fight monster
-- in a room full of teleporter. teleporter destination
-- change every activation
-- was made in a checker patherner since the limitation
-- of the application (would loop teleported entity)
function teleport1()
-- ///////////////////////////////////
-- // all location for the teleport //
-- ///////////////////////////////////
local l1 = {17, 4, math.random(0, 3), 3}
local l2 = {16, 5, math.random(0, 3), 3}
local l3 = {18, 5, math.random(0, 3), 3}
local l4 = {15, 6, math.random(0, 3), 3}
local l5 = {17, 6, math.random(0, 3), 3}
local l6 = {19, 6, math.random(0, 3), 3}
local l7 = {16, 7, math.random(0, 3), 3}
local l8 = {18, 7, math.random(0, 3), 3}
local l9 = {17, 8, math.random(0, 3), 3}
-- /////////////////////////////
-- // table with all location //
-- /////////////////////////////
local table1 = {l1, l2, l3, l4, l5, l6, l7,l8, l9}
-- //////////////////////////////////////////////
-- // this should return a value of the table //
-- // for every teleport(exemple 5 will be l5) //
-- //////////////////////////////////////////////
local random23 = table1[math.random(#table1)]
local random24 = table1[math.random(#table1)]
local random25 = table1[math.random(#table1)]
local random26 = table1[math.random(#table1)]
local random27 = table1[math.random(#table1)]
local random28 = table1[math.random(#table1)]
local random29 = table1[math.random(#table1)]
local random30 = table1[math.random(#table1)]
local random31 = table1[math.random(#table1)]
local random32 = table1[math.random(#table1)]
local random33 = table1[math.random(#table1)]
local random34 = table1[math.random(#table1)]
teleporter_23:setTeleportTarget(random23[1], random23[2], random23[3], random23[4])
teleporter_24:setTeleportTarget(random24[1], random24[2], random24[3], random24[4])
teleporter_25:setTeleportTarget(random25[1], random25[2], random25[3], random25[4])
teleporter_26:setTeleportTarget(random26[1], random26[2], random26[3], random26[4])
teleporter_27:setTeleportTarget(random27[1], random27[2], random27[3], random27[4])
teleporter_28:setTeleportTarget(random28[1], random28[2], random28[3], random28[4])
teleporter_29:setTeleportTarget(random29[1], random29[2], random29[3], random29[4])
teleporter_30:setTeleportTarget(random30[1], random30[2], random30[3], random30[4])
teleporter_31:setTeleportTarget(random31[1], random31[2], random31[3], random31[4])
teleporter_32:setTeleportTarget(random32[1], random32[2], random32[3], random32[4])
teleporter_33:setTeleportTarget(random33[1], random33[2], random33[3], random33[4])
teleporter_34:setTeleportTarget(random34[1], random34[2], random34[3], random34[4])
end
function teleport2()
local l10 = {16, 4, math.random(0, 3), 3}
local l11 = {18, 4, math.random(0, 3), 3}
local l12 = {15, 5, math.random(0, 3), 3}
local l13 = {17, 5, math.random(0, 3), 3}
local l14 = {19, 5, math.random(0, 3), 3}
local l15 = {16, 6, math.random(0, 3), 3}
local l16 = {18, 6, math.random(0, 3), 3}
local l17 = {15, 7, math.random(0, 3), 3}
local l18 = {17, 7, math.random(0, 3), 3}
local l19 = {19, 7, math.random(0, 3), 3}
local l20 = {16, 8, math.random(0, 3), 3}
local l21 = {18, 8, math.random(0, 3), 3}
local table1 = {l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20, l21}
local random35 = table1[math.random(#table1)]
local random36 = table1[math.random(#table1)]
local random37 = table1[math.random(#table1)]
local random38 = table1[math.random(#table1)]
local random39 = table1[math.random(#table1)]
local random40 = table1[math.random(#table1)]
local random41 = table1[math.random(#table1)]
local random42 = table1[math.random(#table1)]
local random43 = table1[math.random(#table1)]
teleporter_35:setTeleportTarget(random35[1], random35[2], random35[3], random35[4])
teleporter_36:setTeleportTarget(random36[1], random36[2], random36[3], random36[4])
teleporter_37:setTeleportTarget(random37[1], random37[2], random37[3], random37[4])
teleporter_38:setTeleportTarget(random38[1], random38[2], random38[3], random38[4])
teleporter_39:setTeleportTarget(random39[1], random39[2], random39[3], random39[4])
teleporter_40:setTeleportTarget(random40[1], random40[2], random40[3], random40[4])
teleporter_41:setTeleportTarget(random41[1], random41[2], random41[3], random41[4])
teleporter_42:setTeleportTarget(random42[1], random42[2], random42[3], random42[4])
teleporter_43:setTeleportTarget(random43[1], random43[2], random43[3], random43[4])
end