December 16, 2017, 12:43am
local sound = Instance.new("Sound",workspace)
sound.SoundId = "rbxassetid://502022490"
Doesn’t work in game or in studio on both client and server.
December 16, 2017, 1:11am
AFAIK :Ended is called when the sound actually ends, not when it’s stopped. So your result seems like expected behavior.
Maybe you want to use the
:Stopped event instead?
as mentioned above, you want to use the .Stopped event for this
if you want to make the same things happen on both stopping the sound and when the sound ends, you can just do this
print("stopped or ended")
December 16, 2017, 3:07am
@PressurizedSphere according to http://wiki.roblox.com/index.php?title=API:Class/Sound/Ended
This event will fire whenever the sound has ended playing,
either because :Stop() was called on the sound or the end of the sound was reached.
December 16, 2017, 3:15am
Interesting. Not sure if that’s the intended behavior or just an incorrect description.
Would definitely prefer if the current behavior is kept though, since it gives an easy way to know when the sound actually finishes playing. If you need a to do something when the sound either stops or ends, using two events like
@PressurizedSphere suggested seem pretty simple.
If the current behavior is not kept, it will be impossible to tell if a sound Ended or Stopped. I agree with keeping the existing behavior and changing the wiki documentation.
Yeah that description of it firing when Stop is called is inaccurate.
Ended fires when a sound finishes its playback without any intervention.
The event isn’t broken, it’s just described incorrectly.
cc @UristMcSparks @cowbear16
December 28, 2021, 12:40pm
Gonna push this, as it’s been 4 years and this is still broken
For some reason, my song isn’t firing the Ended event.
Pasted as is
if not CurrentSong.Looped then -- Not a looped song (plot music)
print(CurrentSong) -- prints Plot-1
--// Continue playing plot music
CurrentSongLoopConnection = CurrentSong.Ended:Connect(function()
print("Stopped", CurrentSong.Name) -- Never prints
local SongIndex = string.gsub(CurrentSong.Name, "%D", "")
if not SongIndex then return end
if not tonumber(SongI…
Have you tried using
December 28, 2021, 2:21pm
Review the responses above, the answer is already given, no need to bump.
Feel free to file a documentation request in
#bug-reports:developer-hub . Marking solution and closing.