Hello,
I’ve made a little script to play some music, and the script is working perfectly fine when I join the game from roblox, when I press the run button in studio, and when I test it with server and clients, but it isn’t working when I press play/play here in studio. I can’t figure out what’s wrong.
Here is the script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local musicFolder = ReplicatedStorage:WaitForChild("BackgroundMusic")
local availableMusic = musicFolder:GetChildren()
while true do
for i, sound in pairs(availableMusic) do
if sound.IsLoaded then
sound:Play()
sound.Ended:Wait()
else
sound.Loaded:Wait()
sound:Play()
sound.Ended:Wait()
end
end
end