Action random tp rune

Azi

Banned User
Joined
Aug 12, 2007
Messages
1,167
Best answers
0
Reaction score
51
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"/>
 

BrasseN

New Member
Joined
Jul 18, 2007
Messages
415
Best answers
0
Reaction score
2
What can it do?
Tp you to a random place? o_O
 

Neo

New Member
Joined
Aug 10, 2007
Messages
19
Best answers
0
Reaction score
0
Sounds cool, but what exactly does it do :O?
 

Punketx

New Member
Joined
Aug 13, 2007
Messages
31
Best answers
0
Reaction score
0
This rune teleport u a random place =S plz explain
 

JayBeee

Retired Global Mod
Joined
Jun 2, 2007
Messages
5,225
Best answers
0
Reaction score
13
Location
Sweden
I guess that if you use the rune it will randomly teleport you to one of the coordinates that you assigned in the script.
 

BrasseN

New Member
Joined
Jul 18, 2007
Messages
415
Best answers
0
Reaction score
2
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
 

Juggalo_user

New Member
Joined
Aug 26, 2007
Messages
16
Best answers
0
Reaction score
0
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...
 

WolfClaw

Member
Joined
Dec 3, 2007
Messages
37
Best answers
0
Reaction score
5
Can this be done with teleporters? Like changing the onUse into StepIn?
 

WolfClaw

Member
Joined
Dec 3, 2007
Messages
37
Best answers
0
Reaction score
5
Hmm, gonna test it out as soon as i come home.
 

Mummrik

Hey!
Joined
Oct 22, 2007
Messages
680
Best answers
25
Reaction score
108
Location
Sweden
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++
 

Herpicus

Web Developer
Joined
Jun 21, 2008
Messages
1,644
Best answers
0
Reaction score
85
Location
British Columbia
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
 

Sync

Ø,ø
Joined
May 26, 2009
Messages
1,876
Best answers
0
Reaction score
19
Location
Canada
Yeah that could makea funny onstep teleporter lol
 
Top