3 Decimals Script

I’m trying to create a random x position but i need to make it between 1.000 and 0.000 so it could be 0.434 but how would i make it random with decimals or there is a better way to make random because its a gui so, can someone help me?

Try to do the following for the script:

Random.new():NextInteger(0,1000)*0.001

If you need to show a number with a TextLabel or something like that & want to round it to n decimals, you could do

string.format("%.3f", Number)

^ 3 is the amount of decimals it’s rounded to, although do note that this function returns a string rather than a number

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.