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

Tiny bit of help with this music playlist?

Asked by
Ripik 5
9 years ago

Hi, I wanted to put this music playlist in my roblox game and have it repeat, but whenever the first song ends, the next one queued won't play. Can someone tell me what I am doing wrong?

repeat game.Workspace.Sound:Play() length = game.Workspace.sound.TimeLength wait (length) game.Workspace.sound.SoundId = 'rbxassetid://47330098' game.Workspace.Sound:Play() wait (length) game.Workspace.sound.SoundId = 'rbxassetid://246133596' game.Workspace.Sound:Play() wait (length) game.Workspace.sound.SoundId = 'rbxassetid://160288504' game.Workspace.Sound:Play() wait (length) game.Workspace.Sound:Stop()

until false

Any help is appreciated + Thanks in advance!

2 answers

Log in to vote
0
Answered by
Traide -2
9 years ago

Is that the full script?

0
So far, yes. Ripik 5 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

First, you should really use the codeblock function of the question/answer thingy majig

repeat game.Workspace.Sound:Play()
     length = game.Workspace.sound.TimeLength
     wait (length)
     game.Workspace.sound.SoundId = 'rbxassetid://47330098' 
    game.Workspace.Sound:Play() wait (length) game.Workspace.sound.SoundId = 'rbxassetid://246133596'
     game.Workspace.Sound:Play() wait (length) game.Workspace.sound.SoundId = rbxassetid://160288504' 
    game.Workspace.Sound:Play() wait (length) game.Workspace.Sound:Stop()

until false

also, this could be more organized with tables and loops that are not repeat until false loops.

local soundids = {}
local sound = Instance.new("Sound",game.Workspace)

while true do
    for i,v in pairs(soundids) do
        local _sound = sound:Clone()
        _sound.SoundId = "rbxassetid://"..v
        _sound:Play()
        wait(5)
        _sound:Destroy()
        wait(_sound.TimeLength)
        _sound:Stop()
        print("done done")
    end
end

Answer this question