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

Shuffling my Music Playlist?

Asked by 4 years ago
Edited 4 years ago

Everything works really fine, i just need it to be shuffled. Any help?

local sound1 = 833322858
local sound2 = 225000651
local sound3 = 376154983
local sound4 = 2572422547
local sound5 = 4277136473
local sound6 = 2573916672
local sound7 = 2176524543
local sound8 = 2284126397
local sound9 = 2521392429
local music = script.Parent
    while true do
wait()
music.SoundId = "rbxassetid://"..sound1
music:Play()
music.Ended:wait()

music.SoundId = "rbxassetid://"..sound2
music:Play()
music.Ended:wait()

music.SoundId = "rbxassetid://"..sound3
music:Play()
music.Ended:wait()

music.SoundId = "rbxassetid://"..sound4
music:Play()
music.Ended:wait()

music.SoundId = "rbxassetid://"..sound5
music:Play()
music.Ended:wait()

music.SoundId = "rbxassetid://"..sound6
music:Play()
music.Ended:wait()

music.SoundId = "rbxassetid://"..sound7
music:Play()
music.Ended:wait()

music.SoundId = "rbxassetid://"..sound8
music:Play()
music.Ended:wait()

music.SoundId = "rbxassetid://"..sound9
music:Play()
music.Ended:wait()


    end

1
I recommend using array instead of separately defining all of them, and it will be easier to shuffle them using index. LinavolicaDev 570 — 4y

Answer this question