TrueRandom - A Solution to Pseudo-random Numbers

I don’t feel like going back of forth on this, so I’ll say this one last time.

REGARDLESS OF RATELIMITS:

If you do not need true random numbers (such as those generated from atmospheric noise through an API), use Random.new.

if you do need true random numbers (in the case of chance and dice games), then use this module.


If you are still concerned about rate-limiting, generate only a couple RNG objects and share them between scripts and/or modify this module to your liking.

1 Like

Please wrap the request with a promise or something similar - instantiation of the random object can stall a script for up to 3-4 seconds. Speaking of the HTTP request, failing a request will cause the backup for loop that generates math.random to also fail as the limit is self.DefaultListLenght.

As well, creating multiple of these objects is incredibly finicky, as the request fails fairly often.

Having your game rely on an external service to work is a recipe for disaster and I fail to see what problem this module is actually supposed to solve.
Unless you work in cybersecurity you shouldn’t worry at all about the “randomness” of your random number generators and I am pretty sure if I gave you a random sequence of numbers you wouldn’t be able to tell which one was generated by Random.new() and which one by that external API or which numbers would be next in sequence without knowing the seed the numbersequence was generated with.

2 Likes

It’s a cool module, but as the others said, you don’t really need true randomness because pseudo-randomness is sufficiently adequate for just about anything that needs random numbers. There are practically no use cases for true randomness on Roblox.

1 Like

It’s absolutely impossible to make a true random number generator, using just code, yours may be very random, but it isn’t true random.

sorry for the bump.

1 Like

Line 28 has a bug (line 28 without the documentation at the top), self.DefaultListLength is spelled wrong,

Yes but Roblox’s random uses (os.time%max)+min I think so it is predictable over time

Sorry for bumping this, but this module is absolutely not true randomness, even if the site says it’s true random it ISN’T. and will never be true randomness without a physical chip, and Roblox can’t access physical chips.

I don’t quite understand why you’ve posted essentially the same thing twice now in the space of a little over a month?

Either way, if you’d read what the site says it does to generate randomness, you would see that it says it uses atmospheric noise to generate random numbers, it isn’t only using pseudo-random algorithms.

2 Likes

It doesn’t matter if you use noise, it’s still not true random.

This is an old thread and I no longer maintain this module.

However, the numbers generated from random.org are indeed TRUELY random (or at least as random as the earth’s atmosphere). The noise is generated from data collected by observing the atmosphere of our planet which, for the foreseeable future, is not controlled by any algorithm or strict pattern.

What you may be thinking about is pseudo-random numbers. As opposed to numbers generated via means of observing our planet, pseudo-random numbers are generated by grabbing a seed (usually just the unix time) and using math to generate somewhat “random” numbers using that seed.

For as long as the universe we live in is as random and unpredictable as it is, random.org (and other randomness apis) will continue to provide completely and truely random numbers.

2 Likes

This is a very unsmart sentence. Just “checking” if it’s not the same everytime isn’t going to get you any better solutions. The whole point of randomness is to create an enviroment that automatically evaluates different numbers, if you’re making the chances yourself, based on your chances. But just checking if it’s the same number literally waters the entire module down to another plain old math.random() generator. It’s supposed to do that.