MakeDiceRoll - ANDR PapyrusFunctions

From the CreationKit Wiki
Jump to navigation Jump to search

Member of: ANDR_PapyrusFunctions Script

Rolls a certain number of dies, with an optional modifier, and returns the result as an Int.

Syntax[edit | edit source]

Int Function MakeDiceRoll(int iNumberOfDice, int iNumberOfSides, int iModifier = 0)  global native

Examples[edit | edit source]

Int iDiceRollResult = ANDR_PapyrusFunctions.MakeDiceRoll(3, 6, 2)

Debug.Trace("We rolled 3d6+2. This result was " + iDiceRollResult + ".")

Parameters[edit | edit source]

  • iNumberOfDice: The number of dice.
  • iNumberOfSides: The number of sides on the die.
  • iModifier: An optional modifier to add to the final result.

Return Value[edit | edit source]

The result of the roll as an Int.

See Also[edit | edit source]