So I'm scripting a new game but for some reason when I call the event known as .Ended towards the sound it doesn't work! The code is located at the top of the script. I've even tried coroutines.
script.Song.Ended:connect(function() print("Song has ended!") end)
In studio it works but ingame it doesnt. I am using a serverscript.
Just try this, after playing the song ,Song:Play(), add a wait(Song.SoundLength) It's probably not called .SoundLength but you can find what it's called in the properties. And then after the wait that's when the song has ended. Here's and example,
Song = game.Workspace.SoundFolder:FindFirstChild("MyLittlePonySong") if not Song then return end Song:Play() wait(Song.SoundLength) -- like I said, it's probably not called sound length print("Song has ended!")
Hope I helped!