#Sound.PlaybackSpeed doesnt work when i use math.random()

1 messages · Page 1 of 1 (latest)

young pawn
#

When i use an exact number like 0.5 or 1.5 it works but when i use math.random(0.5, 1.5) sometimes it just doesnt play

while p.Parent do
    zap.Volume = 0.25
    zap.PlaybackSpeed = math.random(0.5, 1.5)
    print(zap.PlaybackSpeed)
    zap:Play()
    
    particle2:Emit(1)
    particle1:Emit(10)
    task.wait(3)
end

i tried printing the playbackspeed but it just returns 0 and 1.

night elk
#

I think math.random only does integers

#

U gotta do like math.random(5,15)/10

young pawn
#

it worked ty

drifting adder
#

As math.random() by itself gives a decimal from 0-1 with a lot of decimal places

tardy steppe