Why cant i use a variable in the random integer block

You can use it, but NOT while initializing a variable
Move your blocks to the Screen Initialize event

Taifun