Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

What are the Difference between "randomseed" and "random"? [closed]

Asked by
woodengop 1134 Moderation Voter
9 years ago

I apologize if this Question has been asked before(I have slow WI-Fi), What are the Differences between randomseed and random (math), I also have seen the Tick() inside randomseedwhat is the use of that too?

*Help would be appreciated(for my studying) *

Locked by TheMyrco

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

2 answers

Log in to vote
3
Answered by
yumtaste 476 Moderation Voter
9 years ago

Using random() isn't actually random. It is set. For example, if you do math.random() in a game instance 3 times, then do it again in another instance, you'll notice that the numbers are the same. Randomseed resets these numbers. So, if you want truly random numbers, do randomseed before doing random(). If you'd like to read more about this, you can on the wiki.

0
Ohhh...So using "random" wont truly randomize things. woodengop 1134 — 9y
0
Thank you kind sir. woodengop 1134 — 9y
0
You're welcome, kind sir. yumtaste 476 — 9y
Ad
Log in to vote
2
Answered by 9 years ago

Random functions use built in formulas generate a "Random number". Computers cannot generate a random number without a pre-existing number.

Random member functions usually use the system time to generate a "Random number". But the start point of the random number can be changed to create a better random number. More Info Here

randomseed is used to manually set the start point of random number generating to give a better random number.

To truly get a random number you need randomseed that cannot be replicated unlike time. I have heard of a random number generator which used the noise from the HHD to generate a random number as the noise can never be re created unlike time which will repeat.

0
Thank you kind sir. woodengop 1134 — 9y
0
:P User#5423 17 — 9y