math.random number range

How would i set up a math.random to do something like this

[LUA]if math.random(1,100) == 1 through 10 then[/LUA]

instead of jsut having 1 number like

[LUA]if math.random(1,100) == 1 then[/LUA]

A for loop.

Could you give me an example?

[LUA]local rand = math.random(1, 100)
if rand >= 1 and rand <= 10 then[/LUA]

Thank you

You don’t need to test if the random is less than 1, because it never will be (you set 1 as the lower bound), you could just use
[lua]if math.random(100) < 10 then
–Code
end[/lua]