
Just a little QoL Script People might like. It Automatically notifies in chat when you roll two pairs on the d8's on the new 2024 Chromatic Orb for the leap effect. Made for the D&D 5E (2014) By Roll20 Legacy Sheets, untested on the 2024 Sheets. on("chat:message", function(msg) {
// Check if the message contains inline rolls and mentions Chromatic Orb
if (msg.inlinerolls && msg.inlinerolls.length > 0 && /chromatic orb/i.test(msg.content)) {
const rollCounts = {};
// Loop through all inline rolls to find dice results
msg.inlinerolls.forEach(roll => {
if (roll.results && roll.results.rolls) {
roll.results.rolls.forEach(diceRoll => {
if (diceRoll.results) {
// Count the frequency of each rolled value
diceRoll.results.forEach(die => {
const value = die.v;
rollCounts[value] = (rollCounts[value] || 0) + 1;
// Check if any value has been rolled at least twice
if (rollCounts[value] >= 2) {
// Notify the GM about the matching pair
sendChat("", `/desc The Chromatic Orb LEAPS with matching dice rolls of ${value}!`);
}
});
}
});
}
});
}
});