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

Sending A Message Upon 0 HP

Does anyone know of a way to make a message send in-chat when a tokens HP bar reaches 0? We have some homebrew rules when players go unconscious but we always forget about them so I want to add in a message reminder that pops up whenever someone reaches 0.
1680971821

Edited 1680972257
try this as an MOD, change the bar# if needed. on("change:graphic:bar1_value", function(obj, prev) { if(obj.get("bar1_value") <= 0 && prev["bar1_value"] > 0) { var character = getObj("character", obj.get("represents")); if(character) { sendChat("API", "/me " + character.get("name") + " has fallen unconscious!"); } else { sendChat("API", "/me " + obj.get("name") + " has fallen unconscious!"); } } });
1680982558

Edited 1680982576
Kilter said: try this as an MOD, change the bar# if needed. on("change:graphic:bar1_value", function(obj, prev) { if(obj.get("bar1_value") <= 0 && prev["bar1_value"] > 0) { var character = getObj("character", obj.get("represents")); if(character) { sendChat("API", "/me " + character.get("name") + " has fallen unconscious!"); } else { sendChat("API", "/me " + obj.get("name") + " has fallen unconscious!"); } } }); That works perfectly! Thank you!