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

My First Script!

HI ALL!!! I want share with all my first roll20 Script, very simple, but i must start from samewhere (sorry for my bad italian english) Thi Script create a message alert for Character that have "HEAVY ARMOR MASTERY" beacuse i never remeber. I Assumethat token marker strong indexing the Feat and HP are in bar2. on("change:graphic:bar2_value", function(obj, prev) {     if(obj.get("bar2_max") === "") return;     var damageTaken = 0;     var currentHp =0;     var oldHp = 0;     var damage_reduction=0;     currentHp = obj.get("bar2_value");     oldHp = prev["bar2_value"];     damageTaken = currentHp - oldHp; damage_reduction =obj.get("status_strong");     if (damageTaken < 0  && damage_reduction == true){         sendChat("Heavy Armor Mastery:", "/desc " + obj.get("name") + " riduce  i danni non magici da taglio, impatto e perforazione di 3");     } });    
1614975683
timmaugh
Forum Champion
API Scripter
Sweet. Well done!
§Thanks :)