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

Action random tp rune

Azi

Banned User
Joined
Aug 12, 2007
Messages
1,167
Reaction score
53
Location
Włocławek
rand_tp.lua
Code:
function onUse(cid, item, frompos, item2, topos)

local pos = {{x=10, y=10, z=7}, {x=20, y=20, z=7}, {x=30, y=30, z=7} ,{x=40, y=40, z=7}} -- position to teleport.

local rand = math.random(1, #pos)
doTeleportThing(cid, pos[rand])
doSendMagicEffect(10, pos[rand])

end

actions.xml
Code:
<action itemid="2266" script="rand_tp.lua"/>
 
I guess that if you use the rune it will randomly teleport you to one of the coordinates that you assigned in the script.
 
I guess that if you use the rune it will randomly teleport you to one of the coordinates that you assigned in the script.

Then it's not random? haha funny ;)
J/K.
It's random for players :p
 
I believe if you wanted you could make it random by making a table (could cause lag), and it would call a different positions each time, but you would have to limit it, so you don't try to tp somewhere there isn't anything...but I suggest if you do this, only gms use it because players could get killed......get into houses, or other places they don't belong...
 
Can this be done with teleporters? Like changing the onUse into StepIn?
 
i can find this kinda usefull for portals to the enchanting gem places
i might use some of this code in my portal script thx rep++
 
Lol, nice. Im going to use it. Im going to make it like its either Jail, Orshabaal Spawns, Middle of a Maze, or 100CC

Thanks
 
Back
Top