For my game, I’m using a script located in the workspace to play background music in the game. I have several instances
Issue: The script works, but sometimes after each song is done, there is a long pause before the next song plays.
I have checked all audio and none are broken and I’ve tried rewriting this is different ways but they all have this same problem.
script:
while true do
local Sounds = script:GetChildren()
local RandomIndex = math.random(1,#Sounds)
local RandomSound = Sounds[RandomIndex]
RandomSound:Play()
RandomSound.Ended:Wait()
end