|
| 22 Feb 2014 11:36 AM |
Please help. I want something like math.random(1,100) but instead of having whole numbers, I want to decimals too. |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2014 11:59 AM |
| what if you did it out of 1000 then divided by 10. hm idk |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2014 12:04 PM |
local x = math.random(1, 100) x = x / 100
(100 would become 1, 50 would become 0.5) |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2014 12:05 PM |
| Oh wait, you mean you want 1 - 100 including decimals? |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2014 12:05 PM |
math.random() with no arguments returns a random decimal between 0 and 1.
You could do:
local x = math.random() x = x * 100 |
|
|
| Report Abuse |
|
|