How to mention a big number range in math.random

I want a way to mention a big number range, because I am making a math.random from 1 to 1000, I dont know how to do it, please help lol

local minn = game.ServerStorage.MinRandom.Value
local maxn = game.ServerStorage.MaxRandom.Value
local mlti = game.ServerStorage.Multiplier.Value
-- testing stuff
print(math.random(minn,maxn)*multi)
-- The Rest is cut off to prevent exploiters from exploiting it.

Try to use math.huge instead. . . . . . .

from roblox doc:

Keep in mind this is a value and not a range, so write: math.random (1,math.huge)

1 Like

math.random casts doubles (which includes special values - Infinity and NaN) to signed 32-bit integer. On x86 machines compiled by gcc/clang, if it’s a special value or outside of the signed 32-bit range then it is casted to minimum value of 32-bit signed integer.

math.huge is C’s HUGE_VAL as stated in Roblox documentation which is Infinity as represented from IEEE 754 floating point standard therefore it’s not part of the standard signed 32-bit integer format.

As a result, it’ll probably error that “interval is empty”.


To OP: What do you mean by “mentioning big number range”?
What are you trying to do?

im trying to see if a number is from 100 - 200, then give the player that money

Try comparing if it’s greater than or equal to the minimum and less than or equal to the maximum

x >= 100 and x <= 200

Is this what you’re looking for?