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

What does number m and number n in math.random mean?

math.random(number m, number n)

1 comment

0

M = Minimum N = Number (Maximum)

print(math.random(5, 10)) -- Gives any random number between 5 and 10

1 answer

✓ Accepted answer

As mentioned in the above answer, the two arguments mean these two things:

  • M is the minimum number.
  • N is the maximum number.

However, number can be a bit misleading. This is because math.random() only takes integers, not floating-point numbers (decimals). That means that this would work...

local num = math.random(1, 10)

...but this would throw an error:

local num = math.random(0.01, 0.1)

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