Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I stop all playing sounds?

I have a script that randomly picks a song and plays it, if I do the same thing and add :Stop() it will just randomly pick a song to stop. How could I get all running sounds and stop them?

1 answer

✓ Accepted answer

group the songs together in a table. Use a for statement. Make them all stop.

local songs = script.Parent.Songs:GetChildren()

for _,u in ipairs(songs) do
	if u.ClassName == "Sound" then
		u:stop()
	end
end

This discussion is preserved as it was. New answers, comments, and votes are closed.