AnyDice

highest NUMBER of DICE

This function yields the sum of the highest NUMBER values rolled by DICE.

Examples

output [highest 3 of 4d6]
output [highest d4 of 4d6]

Do it yourself

function: highest NUMBER:n of DICE:d {
 result: {1..NUMBER}@DICE
}

There are also variants to mix multiple dice pools:

output [highest 3 of 3d6 and 1d8]
output [highest 3 of 2d6 and 1d8 and 2d10]