Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Running a function when a song ends..?

Asked by 9 years ago

So I've noticed that wait(song.TimePosition) works in studio, but not in-game. I learned this after several hours of code that, but anyways... Is there any way to run a function when a song ends?

1 answer

Log in to vote
1
Answered by
bno23 30
9 years ago

There is an event, 'Ended' contained in sound.

ex:

audio.Ended:connect(function()
    -- code
end)
0
This event only works in studio, not in game. UnleashedGamers 257 — 9y
0
Very interesting. Looking at this more, the event does not even appear to fire with scripts. bno23 30 — 9y
0
Figured it out: the audio.Ended event only works on localscripts. bno23 30 — 9y
Ad

Answer this question