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

Bloodied and dead little mod

Hi! Been playing around with Bloodied and dead, managed to figure out how to change the trigger from 50% down to 25%.  But I've also been trying to get the red marker to vanish when the token "dies".  I tried this: on("change:graphic", function(obj) {     if(obj.get("bar1_max") === "") return;         if(obj.get("bar1_value") <= obj.get("bar1_max") / 4) {         obj.set({               status_redmarker: true         });     }     else{         obj.set({             status_redmarker: false         })     }     if(obj.get("bar1_value") <= 0) {       obj.set({          status_dead: true           status_redmarker: false       });     }     else {       obj.set({         status_dead: false       });     } }); The bit I added in bold and italic. It seems to stop everything from working?  I'm a complete novice to the API thing, I see the if and else triggers(?) is there an unless trigger? was thinking,  If  bar1 under 25% redmarker Unless   bar1 <= 0 Any help would be appreciated on the matter. 
1487797074

Edited 1487797365
I am pretty sure you can only set one attribute at a time.  Change the .set to two commands.   obj.set ({status_redmarker: false}); obj.set ({status_dead: true}); If you can set two attributes in one cammand you need a (,) inbetween the to hash enters.  obj.set ({     status_redmarker: false,     status_dead: true });
1487800678

Edited 1487800721
Have you seen this script Wolverine? <a href="https://app.roll20.net/forum/post/4630083/script-a" rel="nofollow">https://app.roll20.net/forum/post/4630083/script-a</a>... Click to see the animation.
1487820193
Tetsuo
Forum Champion
I modified mine to remove the red dot Mobile can't copy paste from the editor apparently. Here's mine. The change you want to make is on line 4
Franky H. said: I modified mine to remove the red dot Mobile can't copy paste from the editor apparently. Here's mine. The change you want to make is on line 4 Perfect! Works just how I wanted, thank you :)&nbsp; @ skycaptain Thanks for the suggestion but I think just the blood splatter effect works for me at 25%, just so the PC's know how they're almost there.&nbsp; @Micheal S Thank you also for your suggestion, I haven't tested what you put, but it seems to make sense to me, I shall make note of it if I modify other scripts.