Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // wrap code into async function
- let flightFunc = async function() {
- const tokens = canvas.tokens.controlled;
- for (const token of tokens){
- if (token.TMFXhasFilterId("flight") || token.TMFXhasFilterId("UnderShadow")) {
- await token.TMFXdeleteFilters("flight"); await token.TMFXdeleteFilters("UnderShadow");
- } else {
- let params =
- [{
- filterType: "transform",
- filterId: "flight",
- padding: 10,
- animated:
- {
- translationX:
- {
- animType: "sinOscillation",
- val1: -0.025,
- val2: +0.025,
- loopDuration: 3500,
- },
- translationY:
- {
- animType: "cosOscillation",
- val1: -0.025,
- val2: +0.025,
- loopDuration: 3500,
- }
- }
- },
- {
- filterType: "shadow",
- filterId: "UnderShadow",
- rotation: 55,
- blur: 1,
- quality: 5,
- distance: 20,
- alpha: 0.5,
- padding: 10,
- shadowOnly: false,
- color: 0x000000,
- zOrder: 6000,
- }];
- await token.TMFXaddUpdateFilters(params);
- }
- }
- };
- // call wrapped function
- flightFunc();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement