Articles on: Blocks Creator
This article is also available in:

🟦 Random number

🟦 Random number


The Random number block allows you to generate a random numerical value between two user-defined limits. It is essential for introducing randomness into experiences, such as game mechanics, simulations or dynamic decisions.


This block provides flexibility to produce integers or decimal numbers, depending on the needs of the scenario.


πŸ“₯ Entries


  • from (Number): Minimum possible value (lower limit). Default: 0.
  • to (Number): Maximum possible value (upper limit). Default: 100.
  • decimal (Boolean): If True, generates decimal numbers. If False (default), generates only integers.


πŸ“€ Outings


  • value (Number): Random result generated according to the parameters. Can be used in conditions, variables or dynamic displays.


πŸ’‘ Example of use


Scenario: Random variation of rewards in a game


  1. Insert the Random Number block into your feed.
  2. Set from to 50 (minimum reward).
  3. Set to to 200 (maximum reward).
  4. Leave decimal to False to get integer values.
  5. Connect the value output to a Variable block to store the reward.
  6. Then display this value via a Text block to inform the player.


βš™οΈ Technical Details

  • Random generation: Uses the native function of the browser or the Celestory engine, with strict management of the limits to guarantee a result in the interval [from, to].
  • Decimal precision: If decimal is True, the precision depends on the underlying implementation (usually up to 15 decimal places).

Updated on: 04/03/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!