while true do
game:GetService("RunService").Heartbeat:Wait()
if(sound.TimePosition >= 73.8) and (not fade) then
fade = true
for i = 0, 1, -0.1 do
sound.Volume = i
wait(0.5)
end
sound.TimePosition = 0
for i = 0, 1, 0.1 do
sound.Volume = i
wait(0.5)
end
fade = false
end
end
sound.TimePosition = 0 is being ran before the for loop finishes, causing the audio to abruptly jump back to the beginning instead of slowly fading out, then going back to the beginning after the fade finishes. I can confirm that this is the issue as I have another script printing the audio's TimePosition every heartbeat. No other scripts are affecting the audio.

3 comments
I'm using a loop because I want the song to fade out before the song actually ends. Also, this solution would cause the fade out to begin after the audio has already ended. I don't need the song to fade out precisely at 73.8 seconds, and I understand that my solution is hacky.
Also, my goal is to get to 0 in the first loop.
good point, my bad. i wasnt thinking about the ended event. surely you can use it for .Played tho. as for .ended, just replace it with waiting for the time and such.