Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Quick "How To" Question on "Teleport Script Tweaked"

Original thread:&nbsp; <a href="https://app.roll20.net/forum/post/4694539/teleport-script-tweaked" rel="nofollow">https://app.roll20.net/forum/post/4694539/teleport-script-tweaked</a> Hey guys, Im trying to use the random teleport function of this script (Everything else is easy enough and works) but I cant work out what to name the teleport GM tokens to make them randomly teleport between each other when used. I can see in the code where it calls a random integer, but im not savy enough to know what condition calls the random integer over the IndexOf Any insight would be a blessing&nbsp; if( CurrName.match(/^R:/) ) { i = randomInteger(doorCount)-1; } else { i = Letters.indexOf(currDoor);
1559115515
Ziechael
Forum Champion
Sheet Author
API Scripter
That looks like the updated version that The Aaron tweaked at my request to mess with my players... if so, then prefix your portal names with R: and it will apply the 'random selection' factor to them :) ie. R:Portal 1A or R:Teleporter &nbsp;6D etc etc (no idea why it insisted on creating links for those?)