Random func 2

This function randomly generates a value between 0 and, but not including, another value, defined as the. If it is called on the same index on the same frame by the same player, it will return the same value.

Syntax
function_name( mandatory_arguments );

Returns
int (random number)

Basic
// init.gml // randomly sets walk speed to up to 100 at the beginning of the game walk_speed = random_func_2( 0, 100, true );

Advanced
// update.gml // plays a sound 30% of the time when any attack starts if(attack && window = 1 && window_timer = 1){ var attackersound = random_func_2(1, 100, false); if(attackersound > 70){ sound_play(sound_get("sound")); } }