lately, i been having a problem with math.random, i want it to do decimals how do i do this?
math.random()
will return a random decimal between 0-1.
print(math.random()) -- 0.53971289371293
If you want a more specific decimal you can always do something like this:
local x = math.random(10)/10 -- 0.1 - 1 local y = math.random(100)/100 -- 0.01 - 1
If you don't want whole numbers possible:
local x = math.random(0,9)/10 -- 0 - 0.9 x = math.random(0,90)/100 -- 0 - 0.09