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

Song not ending?

Asked by
NotSoNorm 777 Moderation Voter
8 years ago

The song plays and everything it just doesn't get the .Ended part, It doesn't print 'ending song'

y god, y.

for _,k in next,t do
    print('editing values')
    val = val + 1
    scrollframe.Parent.CurrentAudioNumber.Text = "Playing "..val.." out of "..maxnum.. " audios"
    print('playing song')
    k:Play()
    k.Ended:wait()
    print('ending song')
    k:Stop()
end
0
make it a function, k.Ended:connect(function() print("Ending Song...") k:Stop() end) or, while k.IsPlaying == true do wait() end TheDeadlyPanther 2460 — 8y
0
Why didn't you just do a wait function duckyo01 120 — 8y

1 answer

Log in to vote
1
Answered by
Wizzy011 245 Moderation Voter
8 years ago

The event Ended only works for LocalScripts, because sounds on ROBLOX are downloaded directly to the client, so are started at different times for each users. Therefore it's impossible for the server to anticipate when the song has ended.

Solution

Well, there technically is no direct solution to this problem. Either you directly input the length of every song manually, or you play all audios locally or you do a mixture of both.

I have had multiple conversations with JParty (ROBLOX Developer Relations) about this problem, and have suggested they do add some sort of SongLength to the Server side of the code.

Ad

Answer this question