RandomService - Anti-Exploiting and Secure RNG module

RandomService

RandomService is a module that provides a secure way to play with randomness. It does so by scrambling the possibly-computable randomness pattern and makes it nearly impossible to predict and compute the “randomness”!

Installation

Features

  • Lightweight and swift :high_voltage:
  • Anti-Exploiting :no_entry:
  • Many Methods :1234:

API

RandomService:NewInteger(min: number, max: number): number
Generates a Integer between min and max.
RandomService:NewDecimal(): number
Generates a float number between 0 and 1.
RandomService:NewFloatNumber(min: number, max: number, dPlace: number?): number
Generates a float number between min and max with optional dPlace (lowest decimal place) parameter.
dPlace cannot be larger than 17.
RandomService:RandomFromArray(array: {any}): any
Returns a random value from the array with equal odds.
RandomService:RandomKeyFromDict(dictionary: {[any]: any}): any
Returns a random key from the dictionary with equal odds.
RandomService:OneInTwo(): number
Equivalent to RandomService:NewInteger(1,2). Just for fun!
RandomService:RollWithOdds(oddTable: {[any]: number}): any
Rolls a random key from the given dictionary based on their value (odds)

Consider donating! This contributes to my future development a lot.

What do you think about this module?
  • Awesome!
  • Somewhat solid.
  • Not really good.
0 voters

Credits

7 Likes

Does it mean it blocks clients and cheats? For example, does the fly speed tp cheat require adding numbers? As a value

I don’t quite get what you mean, but does it have something to do with randomness?

1 Like

No, I’m saying exactly what kind of cheats does this disable and how exactly?

btw it cant possibly disable cheats entirely, it just decreases the possibility of exploiting to a very low point

1 Like

There’s confusion in your post; I would be under the assumption that this is a “random” anti-cheat. It’s not though, it’s a secure RNG system where the seed can’t be guessed or is constantly changing. You may want to reword the thread’s title and content!

This is also adding to the confusion. It is not making exploits (in general) harder to use, it just makes it nearly impossible to predict the server sided RNG.

1 Like

Thanks for the suggestion! Ill be changing the post

1 Like

Anti-Exploiting is a bit of a stretch but I guess this can be used in handshakes.

1 Like

For the first one, what is the difference between that and math.random?

math.random is not secure enough and the module is here to mitigate it

I feel like I need to share this here

1 Like

How exactly is this anti-exploiting?

@TheRealGavintalks please try to predict this math.random :slightly_smiling_face:

check this :slight_smile:
Im not professional enough to do that but somebody else did

ermmmm, yo’re RNGTable has a flaw, it has 5 of the same RNG Object + 5 isnt enough, please remake it and buff the sample size to 10e5 for better security :pleading_face:

It’s already predictable if you have something like i9-14900k and 30 seconds. Altough not really useful if you don’t directly leak high precision random numbers to client and use math.random without a seed. Also you can just insert a script to call math.random repeatedly to change the state every frame. You don’t need a module for that.

if you think about it, creating 10e5 rng and refreshing it frequently would ridiculously downgrade the performance

but at least there are some additional and non-built-in methods such as :NewFloatNumber() :pensive_face:

I believe you are talking about this video: https://www.youtube.com/watch?v=-aC7tTEFVEo

It took them 30 seconds and a rtx4090 to crack math.random and 10 minutes with the given 0.05 and 0.95 range. The main exploit came from NextNumber being called to generate a visual effect with a high precision raw output. It makes server execute math.random or Random:NextNumber to land on desired output. In the end this can be easily prevented with a simple loop that continously calls math.random. I don’t really get the point of having a seperate module.

1 Like

To further improve your anti-exploiting and randomness, you should make the client decide the seed, and then let the server get the seed with a remotefunction.