Randomize a number?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Schweini

I would like to randomize a “int” number from 100 to 300.
I know that there is a function named randi(), but there are only the same numbers every time I start the game.

:bust_in_silhouette: Reply From: TheBaldChick

Try this:

Var RandomNumber = null      

                                                                                                         func _ready():
 randomize()
 RandomNumber = randi()%200 + 100
 print(RandomNumber)