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

[Advice Needed] Send message on /gmroll

I'm just getting started with the API, but it seems straightforward enough. However, there is something I am not yet entirely sure how to achieve. The goal is deceptively simple: when the GM uses /gmroll for a hidden roll, I would like the players to see a message to the extent of "The GM rolls the dice..." What would be the best way to go about achieving this? I don't think this is really a feature request as much as something that seems to be possible through the API, as it's only suitable for certain campaigns where the GM wishes to replicate the feeling of sheer dread reserved for a calm-faced dungeon master tossing his dice behind an enormous screen and looking unsettlingly contented. I'd greatly appreciate any help with this! NOTE: I realize that the whole matter of "should the GM be allowed to fudge rolls in favor of the plot" is apparently an emotionally charged affair on these forums. This is also the reason why I am trying to go this route rather than implementing a "manipulate rolls" feature. Please do not use this thread as an opportunity to rekindle that old and frankly pointless debate. Thanks.
1396882278

Edited 1396882314
You can capture the GM roll with this: if (msg.type == "gmrollresult") and send your message with this: sendChat(msg.who, "The GM is rolling some dice."); It would say the same thing whether or not it was the GM who called /gmroll, though, and I'm not sure of a consistent way to prevent that. You could find the index of "(GM)" in msg.who as a very basic check, but it does occur to me that you could also just use emotes. Then whoever calls it, GM or otherwise, you get "So and so is rolling some dice." Thus: on("chat:message", function(msg) { if (msg.type == "gmrollresult") { sendChat(msg.who, "/em is rolling some dice."); } }); Cheers!