Get a number between 1 and 10 with math.random

I don’t really know what this is called or how to explain it but I have a math.random that’s 1-100

and when a number is picked I want it to print something if its between 1-10, how do i do that?

The method im using right now is really messy and not optimized,

local a = math.random(1,100)


a = math.random(1,100)

if a == 1 then
	print("1% race rolled gg")
elseif a == 2 or a == 3 or a == 4 or a == 5 or a == 6 then
	print("5% race rolled gg.")
	
	
	
end
if (a <= 10) then
--code
end
1 Like