Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Get token based on turn order?

Is it possible to grab the the token associated with the current selected from the turn tracker? I had a brief look through the docs but couldn't see anything obvious that would suggest I could or couldn't.
Yes. Here's a bit of script that sets 'thisToken' to the current token in the turn order whenever the turn order is updated. on ("change:campaign:_turnorder", function(obj) {     var this_turn = eval(obj.get("_turnorder"))[0];     if ((this_turn.length > 0) && (this_turn[0]._id != -1)) {         var tokenList = findObjs({                                           _pageid: Campaign().get("playerpageid"),                                           _type: "graphic",             _id: this_turn[0].id         });             if (tokenList.length > 0) {             thisToken = tokenList[0];         }     } });
Thank you very much!