You can use
Random.new():NextNumber()*10
although I'd suggest not deleting random objects right after you use them once as that'd get expensive.
So maybe something more like:
local rand = Random.new()
for i = 1,10 do
print(rand:NextNumber()*10)
end
or if you wanted to even make it a function to be more useful,
local rand = Random.new()
function makeRand(place)
place = place or 1
return rand:NextNumber()*(10^place)
end
print(makeRand())
print(makeRand(5))
to further this, incase you wanted to use this within a range you can do something like:
local rand = Random.new()
function makeRand(min,max)
local diff = max - min
local nrand = rand:NextNumber()
nrand = nrand*diff
return min + nrand
end
print(makeRand(100,5000))
print(makeRand(-10,10))
2 comments
If you're on Roblox, https://developer.roblox.com/en-us/api-reference/datatype/Random should work.
https://cdn.discordapp.com/attachments/500095208386723850/622195443916472340/unknown.png