Created
August 3, 2020 23:02
-
-
Save teddy-dev/9906f0ed804bd61eca11d46bd43577fa to your computer and use it in GitHub Desktop.
FoundryVTT - Link all (represented actor only) scene tokens to actor by name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let tokens = canvas.tokens.children[0].children; | |
for (let i = 0; i < tokens.length; i++) { | |
let token = tokens[i]; | |
let actor = game.actors.find(actor => actor.name === token.name); | |
if (actor) { | |
token.update({actorId: actor.id, actorLink: false}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment