reroll

From RPTools Wiki
Jump to navigation Jump to search

reroll() Function

Generates random numbers to emulate dice rolls; returns a dice roll similar to roll() with the difference being that each dice rolled that is lower than the minimum parameter is rerolled until it is at least the minimum.

Usage

reroll(times, sides, minimum)

Parameters

  • times - The number of times to roll the dice.
  • sides - The number of sides the dice possess.
  • minimum - The lowest number a dice rolled can return without being rerolled.

Examples

Roll five ten-sided dice, rerolling any dice rolled lower than five.
[t: reroll(5, 10, 5)]

Returns a number that is between 25 and 50.

Roll five ten-sided dice, rerolling any dice rolled lower than five, using variables.

[h: DiceTimes = 5]
[h: DiceSides = 10]
[h: DiceMinimum = 5]
[t: reroll(DiceTimes, DiceSides, DiceMinimum)]
Returns a number than is between 25 and 50.

See Also

For another method of rolling dice, see Dice Expressions.