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

[Help] Would like to let players use the Teleport script!

Hey there, I am currently using a variation on the teleport script to move around the locations of player tokens. I found it here: <a href="https://app.roll20.net/forum/post/3432348/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/3432348/slug%7D</a> I am sure this is quick fix, but I have no idea how to do it--I just want to modify it so that players can use the !Teleport function as well. If someone could just tell me what I need to modify and how, that would be awesome. Thanks!
1477668717

Edited 1477668897
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
In this section of code: on("chat:message", function(msg) { &nbsp;&nbsp; &nbsp; &nbsp; "use strict"; &nbsp; &nbsp; var cmdName = "!Teleport "; &nbsp; &nbsp; &nbsp; if (msg.type === "api" && msg.content.indexOf(cmdName) !== -1 && playerIsGM(msg.playerid) ) { &nbsp; &nbsp; &nbsp; &nbsp; var cleanedMsg = msg.content.replace(cmdName, ""); &nbsp; &nbsp; &nbsp; &nbsp; var commands = cleanedMsg.split(", "); &nbsp; &nbsp; &nbsp; &nbsp; var targetName = commands[0]; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var i = 1; &nbsp; &nbsp; &nbsp; &nbsp; while ( i &lt; commands.length ) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Teleporter.Teleport(commands[i], targetName); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i = i + 1; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; } }); Delete && playerIsGM(msg.playerid) this will open the entire script to be used by players. edit: bolded it in the code snippet
Nice, worked like a charm. Thank you very much :D
1477672500
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Happy rolling :-D