Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to make music play then fade out?

Asked by 10 years ago

Play an audio/sound at the beginning then have it gradually fade away.

wait(3)
game.Workspace.Sound:Play()

That is all I have

1 answer

Log in to vote
1
Answered by
Sublimus 992 Moderation Voter
10 years ago

What you can use is a for loop with the volume:

wait(3)
game.Workspace.Sound:Play()
wait(timeyouwantittoplaynormally)
for i = 1,100 do
    wait(0.1) --Fades away taking 10 seconds
    game.Workspace.Sound.Volume =  1- (i/100)
end
0
It just stops it abruptly. :I platapus789 5 — 10y
0
Try it now. Sublimus 992 — 10y
0
Same thing happens, I was watching the sound and the volume goes up then it goes to zero. platapus789 5 — 10y
0
Oops, here try it now. Sublimus 992 — 10y
View all comments (2 more)
0
Works perfect, thanks! After looking over it it makes some sense, I learned something :D platapus789 5 — 10y
0
Good! Sublimus 992 — 10y
Ad

Answer this question