So what i want is to be able to have decimals AND whole numbers, but whenever i do, it always rounds it as a whole number.
I want it to change speed every time it loops too, and that doesn't seem to work either. HELP!
1 | sound = script.Parent |
2 | while 5 = = 5 do |
3 | sound.PlaybackSpeed = math.random( 0.25 , 3.00 ) |
4 | print (sound.PlaybackSpeed) |
5 | sound.Ended:Wait() |
6 | end |
You could do something like this
1 | sound = script.Parent |
2 | while 5 = = 5 do |
3 | sound.PlaybackSpeed = math.random( 25 , 300 )/ 100 |
4 | print (sound.PlaybackSpeed) |
5 | sound.Ended:Wait() |
6 | end |
This should give you a decimal between 0.25 and 3
From what I know this should return a random number from 0.1 to 1, whole numbers and decimals included, just alter what the number is divided by etc. to change the min / max
1 | sound = script.Parent |
2 | while 5 = = 5 do |
3 | sound.PlaybackSpeed = math.random( 10 )/ 10 |
4 | print (sound.PlaybackSpeed) |
5 | sound.Ended:Wait() |
6 | end |