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

Would someone help me with sound?

Asked by 10 years ago

I know there's not an event for a sound ending, but how would I make a working music script? I'm trying to make it play a bunch of songs, but I don't know how to time it right. Here's my script:

local musicIds = {130776004,131111368,142295308,130762736,131149175,130969284,130768080,27697392,131065183,130855491,130872377,142991813,27697348}
local sound = Instance.new('Sound', Workspace)
while wait(1) do
    for i, v in pairs(musicIds) do
        sound.Volume = 1
        sound.SoundId = 'rbxassetid://'..v
        sound:Play()
        wait(10)
    end
end

1 answer

Log in to vote
0
Answered by
war8989 35
10 years ago

Listen to each sound and write down how long each track is in seconds. Create a table like this:

local songs = {{["AssetID"] = 1234567, ["Length"] = 15}}

Use that to your advantage.

Ad

Answer this question