Skip to content

Instantly share code, notes, and snippets.

@CydGoblin
Created April 30, 2021 21:01
Show Gist options
  • Save CydGoblin/aedb668b6da947464ccead13b3ba3eec to your computer and use it in GitHub Desktop.
Save CydGoblin/aedb668b6da947464ccead13b3ba3eec to your computer and use it in GitHub Desktop.
Foundry VTT Macros
(async function() {
if (canvas.tokens.controlled.length > 1) {
ui.notifications.error("Please select just one token");
return;
} else if (canvas.tokens.controlled.length !== 0) {
let target = canvas.tokens.controlled[0];
console.log(target.emitsLight)
if (target.emitsLight) {
target.update({ "dimLight": 0, "brightLight": 0})
} else {
target.update({ "dimLight": 40, "brightLight": 20})
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment