engine:functions:mechanics:keephighest

keephighest()

rolls a number of dice and only sums up a selected number of the highest dice.

syntax

 keephighest ( roll: dice, keep: number) : number

Throws an error if you try to keep more dice than you told the engine to roll.

parameters

roll the dice definition to be rolled
keep how many of the dice should be kept.

return
The sum of the kept dice

example

keephighest ( 4d6, 3 ) returns y roll 4 six sided dice, ignore the lowest and sum up the three highest dice