I always simply use random() for calculating random numbers, since I read one of :sen:'s best. And I like it a lot.
Only to generate a float of random numbers I use Math.floor(Math.random()*(max-min+1)) + min
So, this time I had to use both in one script, and I had it checked by a friend who is a way better developer as I am (as far as I’m a developer :lol: ).
He advised me to leave the random() behind.
I replied that there is no reason to, since it sometimes really is a hassle to use “Math.floor(Math.random()*(max-min+1)) + min” when u simply want a random number. “And it’s way faster!”, I added.
“I know, I know”, he said, “but it’s deprecated”. :h:
Why is it deprecated??? It has 2 advantages: it’s shorter and it calculates faster. So I don’t understand why people at MM put it at the deprecated elements.
I will keep using random() for sure… cuz imo both random() and [size=1]that other code [/size][size=2]have their advantages.[/size]