Audio not playing(help)

Hello there!I am new to scripting and i was trying out stuff.In this my audio plays once and after it ends it sends the correct output but does not play any audio.Can you guys help and review my code and tell me what went wrong.Thanks in Advanced :slight_smile:

local playing = game.ReplicatedStorage.MusicPlaying
local music = game.ReplicatedStorage.MusicLists:GetChildren()
local musics = {}
for i,v in pairs(music) do
	table.insert(musics,i,v)
end
local function MusicPlay(AListOfMusic)
	local musicPicked = AListOfMusic[math.random(1, #AListOfMusic)]
	musicPicked:Play()
	playing.Value = musicPicked.Name
	print(musicPicked)
	return musicPicked
end
local musicPicked = MusicPlay(musics)
musicPicked.Ended:Connect(function()
	local musicPicked = MusicPlay(musics)
end)
	
end)

I’m pretty sure this issue is happening because you’re trying to play the audio from ReplicatedStorage. You can only play audios locally in SoundService. Change the parent and let me know if it works.

1 Like

this is false

I’ve played them in ReplicatedStorage locally with no problems

SoundService isn’t the only place

Thanks dude it worked when i changed the file parent to workspace

Somehow putting it in the workspace worked for me

I never tried to play audios in ReplicatedStorage, seems like a bit messy approach for me considering there’s a service dedicated for audios. I thought you could only play them in SoundService.