|
| 25 Feb 2017 12:02 PM |
Math.random(1,4), or (1,6) etc will only return INTEGERS. How can I also get a decimal up to say, the tenths place?
|
|
|
| Report Abuse |
|
|
|
| 25 Feb 2017 12:02 PM |
| math.random(10,40)/10 or math.random(10, 60)/10 |
|
|
| Report Abuse |
|
|
|
| 25 Feb 2017 12:06 PM |
local function random(min,max,decimals) decimals = decimals or 0 return math.random(min*(10^decimals),max*(10^decimals))/(10^decimals) end
print(random(1,4)) print(random(1,4,1)) print(random(1,4,2))
Downgrading STF // https://www.roblox.com/Trade/TradeWindow.aspx?TradePartnerID=6163444 |
|
|
| Report Abuse |
|
|
| |
|