So I have two Background Music files in the workspace called "SurfaceDay" and "SurfaceNight." I use this script down below.
minutesAfterMidnight = 0
while true do
minutesAfterMidnight = minutesAfterMidnight + 10
game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
wait(0.1)
if game.Lighting:GetMinutesAfterMidnight() > 6 * 60 and minutesAfterMidnight < 17 * 59 then
if game.Workspace.SurfaceDay.IsPaused then
game.Workspace.SurfaceNight:Stop()
game.Workspace.SurfaceDay:Play()
end
end
if game.Lighting:GetMinutesAfterMidnight() > 18 * 00 and minutesAfterMidnight < 6 * 59 then
if game.Workspace.SurfaceNight.IsPaused then
game.Workspace.SurfaceDay:Stop()
game.Workspace.SurfaceNight:Play()
end
end
end
The problem here is that if the time was nighttime, the Night music only plays once when I set it to loop, and if the time was daytime, the Day music played but the Night music never plays. Is there a reason for this problem and how do I fix this?
Thank you.

1 comment
Get rid of the line that says the other music "IsPaused" for two reasons: 1. I don't see any reason to have it there and 2. IsPaused and basically anything else that detects if the sound has stopped playing is broken.