engine:functions:mechanics:keeplowest

keeplowest()

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

syntax

 keeplowest ( 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

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