dice
Rolls dice notation, such as 1d4+2.
Source: src/Moongate.Server.Ultima/Modules/DiceModule.cs
Functions
Section titled “Functions”dice.roll(expression) -> integerRolls a dice expression such as 1d4+2 or 4d6k3, the forms of DiceSpec; a malformed one raises an error naming it.
| Parameter | Type | Default |
|---|---|---|
expression | string |
Returns integer.
try_roll
Section titled “try_roll”dice.try_roll(expression) -> integer?Rolls a dice expression such as 1d4+2, or returns nil when it is malformed: dice.try_roll(text) or 0.
| Parameter | Type | Default |
|---|---|---|
expression | string |
Returns integer?.
Made with ❤️ by Tom
