Here's a fairly simple script that could do with some work on presentation. on("chat:message", function (msg) {
if (msg.type === "api" && msg.content.indexOf("!damage-group") !== -1)
{
let args = msg.content.split("--");
let howMany = parseInt(args[1])||0;
let diceExpression = args[2];
diceExpression = diceExpression.replace("[","[["); // this is just to handle nested inline rolls
diceExpression = diceExpression.replace("]","]]");
let description = args[3];
let output = "";
for(var i = 0;i < howMany;i++) { // copy the roll expression multiple times
output = output + "[[" + diceExpression + "]]";
}
output = output + " " + description;
sendChat(msg.who,output); // replace msg.who with "player|"+msg.playerid" to get player icon
}
});
You would call this with !damage-group --3 --2d6+2 --rending attack
or
!damage-group --?{How Many|1} --2d6+@{selected|STR} --rending attack
or
!damage-group --?{How Many|1} --4d6k3+@{selected|STR} --rending attack
Do not include double brackets in the damage expression, that will cause roll20 to roll it before it reaches the script, and they can't then be duplicated. If you need nested inline rolls, just use single brackets, the script will convert them to doubles. for example: !damage-group --?{How Many|1} --[4d6k3]+[4d6k@{selected|STR}] --rending attack (You dont actually need nested inline rolls in the above example, it's just for sake of example.)