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 .
×
Advertisement Create a free account

Concentration API Scriptlet bugged

1620129079

Edited 1620129134
For some reason the sciptlet I've been using for Concentration has decided to fire whether the concentration token is on or not... but only for 2 out of the 5 in the party! Any ideas on how to fix? Thanks for the help! // Customisation for MykeMyke valid @ v1.3 var TOKEN_CONCENTRATING_STATUS_MARKER = "status_" + "concentration::2158671"; on("change:graphic:bar1_value", function(obj, prev) {     if (obj.get(TOKEN_CONCENTRATING_STATUS_MARKER)) {         var playerPage = Campaign().get("playerpageid");         var tokenPage = obj.get("_pageid");         if (prev["bar1_value"] > obj.get("bar1_value")) {             var final_conc_DC = 10;             var calc_conc_DC = (prev["bar1_value"] - obj.get("bar1_value")) / 2;             if (calc_conc_DC > final_conc_DC) {                 final_conc_DC = Math.floor(calc_conc_DC);             }             sendChat("TokenDamage", "&{template:npcaction} {{rname=Concentration Check}} {{description=[DC " +final_conc_DC + " Constitution](~selected|constitution_save)"+ "
" +"*[Toggle Concentration Marker](!token-mod --sel --set statusmarkers|!concentration)*}}");        }     } });
1620134468
It looks like you're using a modified version from here . Just a quick sanity check: do the tokens all have their hp values in bar 1? And which other scripts are you running? Are any of those modifying the values in bar 1? And as Three of Swords mentioned in that post, you don't need the two lines referring to playerPage and tokenPage:         var playerPage = Campaign().get("playerpageid");         var tokenPage = obj.get("_pageid");