As I've talked about and said about the math.randomseed function, although I can't confirm this definition, how it works is that it sets the primary seed for math.random; again, however, I can't confirm this.
math.randomseed can be very buggy and confusing from what I've seen, but I've also seen answers on how to fix this, but I can't find them, so I'll try and repost the answers here:
First, we need to set up randomseed:
BUT! Before we continue, we need to give the function an argument; a number of some sort.
Many recommend using tick
, as it always changes and becomes more random. Lets apply that:
Now it'll work!! :D
Now, I'll be off...
ANSWER THE DANG QUESTION, YOU DIDN'T SAY THE REST!!
Fine. ;-;
After that, from what I've seen, you then call just the math.random function, without giving any argument(s), after you set up the seed. Here's how I've seen it:
That's how I remember others set it up, at least. e-e
Now, when you fire it, it should produce a randomized number:
4 | print (math.random( 1 , 100 )) |
Welp, sadly, that's all I know about it, and how others did it to prevent it from producing the same number over and over again. I'm sorry if this didn't answer your question. ;(
Functions and junk talked about
To note: I've already talked about these previously, so I wont post any definitions again. ;C
The Randomseed Function
The Random Function
Although, I hope this helped you in any way! :D