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”!
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.
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.
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
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.
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.
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.