It works in Play Solo but it does not work when you actually play the game. What is the problem?
function playMusic() game.Players:WaitForChild("Player") if game.Players:findFirstChild("Player") ~= nil then game.Workspace.Music:Play() end end repeat wait(0.1) until game.Workspace.Music ~= nil playMusic()
It is a local script, by the way.
The player is only named 'Player' when you're on PlaySolo. Any other time it's the same name as the person's username. Your script will therefore eternally wait on line 02, since there will never be someone named 'Player' in the actual game.
If you want the music to play whenever the game starts, then you don't need anything nearly as complicated. Just put this code inside the sound:
script.Parent:Play()
It will make the sound play as soon as the game starts.