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

How to take my sound script to the next level?

I have a music system that plays different songs. Every single time the song ends and it takes some seconds for the next one. I use the wait function as so

wait(120)

I am wondering if there is a way to detect when a song ended. Thanks!

2 answers

Use the event sound.Ended.

sound.Ended:connect(function()
	--Do something fancy
end)

1 comment

0

Ended can only be used on the Client, or through Local Scripts. I would normally suggest making most sounds play via client or locally, but this might not be what he wants.

Heres an event that may or may not work: song.Changed("Playing"), heres a line of code to check if its playing: if song.Playing then --returns true if the song is playing, false if it isn't, well yeah thats obvious

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