dec musicval#,0.1 SetMusicFileVolume( fightOrRunMusic, musicval# )
function FadeMusic() if fadeMusicLow=1 musicval#=musicval#-0.3 SetMusicVolumeOGG( fightOrRunMusic, musicval# ) endif if musicval#<0 fadeMusicLow=0 musicval#=0 StopMusic() endif endfunction
As an idea, you could also use a custom tween to change the volume over time then stop the music when the fade tween finishes.