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

[Script] Chromatic Orb 2024

1743767705

Edited 1743943082
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}!`); } }); } }); } }); } });
Updated for Pairs (2 or more) of the same number because I'm a goob who thought it was just 8's on the die.