Skip to content

Instantly share code, notes, and snippets.

Created May 16, 2013 08:46
Show Gist options
  • Save anonymous/5590333 to your computer and use it in GitHub Desktop.
Save anonymous/5590333 to your computer and use it in GitHub Desktop.
roll20 layer changer script
on("chat:message", function(msg) {
if(msg.type == "api" && msg.content.indexOf("!show") !== -1) {
var charName = msg.content.replace("!show ", "");
var charToken = findObjs({_type: "graphic", name: charName})[0];
if(!charToken) {
return;
}
if(charToken.get("layer") == "gm"){
charToken.set("layer", object);
} else {
charToken.set("layer", gm);
}
}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment