Client-based sound won't play but appears to be playing when viewed on server

I’m making a simple music system that will be region based, but the audio that is placed in my client’s playergui won’t play. As far as I am aware everything else seems to be working fine, with no errors, eg. the volume gets manipulated and the sound ID changes, however the sound actually never plays, even though I am using sound:Play(). I have attempted to use sound.Playing = true but that has not worked either. Am I doing something wrong or is this a ROBLOX engine bug?

local fadeTime = 2

local function PlayRandomSound(plr, musicZone)
	local sounds = musicZone.Sounds:GetChildren();
	local plrSound = plr.PlayerGui.Music;
	TweenVolume(plrSound, 0);
	wait(fadeTime);
	local randomSound = math.random(1, #sounds);
	TweenVolume(plrSound, 1);
	plrSound.SoundId = sounds[randomSound].SoundId;
	plrSound:Play();
end

game.Players.PlayerAdded:Connect(function(plr)
	playerZones[plr.UserId] = workspace.MusicZones.Default;
	plr.CharacterAdded:Connect(function()
		local music = plr.PlayerGui:WaitForChild('Music');
		music.SoundId = 'rbxassetid://1389286403';
		PlayRandomSound(plr, playerZones[plr.UserId]);
		music.Ended:Connect(function()
			print('Ended music');
			PlayRandomSound(plr, playerZones[plr.UserId]);
			music:Play()
		end)
	end)
end)

Here’s what I mean, the sound “appears” to play on the server as visible in the developer console, but when looking at the client’s view (in the explorer), it’s not actually playing.

place.rbxl (73.2 KB)

1 Like

I’d just honestly reference the Sound object inside SoundService or the workspace, not sure why you’re placing it inside the PlayerGui since that can tend to have some weird effects