Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to achieve true random?

Roblox's math.random works, but it isn't really random, is there any way I can achieve true random?

3 comments

1

What do you mean isn't really random ?

0

I've never had any problem using math.random. What exactly are you trying to do?

0

I think I've heard people saying math.randomseed(tick()) also increases the randomizing process?

1 answer

✓ Accepted answer

In order to achieve true randomization, simply use Random.new()

Random is the new way of finding completely random numbers.

using a variable for it, you can set it to use Numbers or Integers.

local var1 = Random.new()

var1:NextInteger(min,max) -- gives whole numbers only

var1:NextNumber(min,max) -- gives negatives,decimals,whole numbers, etc.

Sources:

http://developer.roblox.com/en-us/api-reference/datatype/Random

http://devforum.roblox.com/t/a-random-feature/64517

http://devforum.roblox.com/t/math-randomseed-seemingly-broken/96945

1 comment

0

How great! I always used math.random and division to get decimals.

This discussion is preserved as it was. New answers, comments, and votes are closed.