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

How do I make math.Random(0,1) include decimals?

2 answers

✓ Accepted answer

Decimals depends on the arguments you provide, math.random(lower, upper) will generate an integer between lower and upper. You can read what it does here. If you call it without parameters you will get decimals between 0 and 1. You need to combine these calls.

I also suggest you use the new Random type instead of the math library due to it's better implementation but also because it allows you to do it in one call with NextNumber.

1 comment

0

I have no idea why OP didn't accept your answer. I accepted it for you

Just do

print(Math.Random(0,10) / 10)

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