Skip to content

Instantly share code, notes, and snippets.

View JoshWright22's full-sized avatar

Josh Wright JoshWright22

View GitHub Profile
//My solution for 5e current foundry vtt, modified by me from source https://gist.github.com/xdy/bdd08e101fc390016dd432f28c4abfdb
// 1. Filter for valid 5e tokens
const tokens = canvas.tokens.controlled.filter(t =>
t.actor && (t.actor.type === 'character' || t.actor.type === 'npc')
);
if (tokens.length === 0) {
return ui.notifications.warn("Please select at least one Character or NPC token.");
}