Skip to content

Instantly share code, notes, and snippets.

@rileydutton
Forked from anonymous/Layer changer
Last active December 17, 2015 09:59
Show Gist options
  • Save rileydutton/5591511 to your computer and use it in GitHub Desktop.
Save rileydutton/5591511 to your computer and use it in GitHub Desktop.
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") == "gmlayer"){
charToken.set("layer", "objects");
} else {
charToken.set("layer", "gmlayer");
}
}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment