Hey, let’s start of by saying I am not a scripter, this is the first script that I ever made myself so it may be badly optimised etc.
I am trying to make it so my script picks a random song, plays said song, picks another random song, plays said song etc, etc. For some reason my script only plays one song, that’s my issue.
What I would like for someone to do is to either tell me what to put and where or copy my script and add what is needed to be added.
Sadly there is no pay as I have literally nothing to offer. Here is my script:
local sound1 = 717543378
local sound2 = 1893107102
local sound3 = 573369104
local sound4 = 4620422621
local sound5 = 587498104
local music = script.Parent
function Song()
local song = math.random(1,5)
if song == 1 then
music.SoundId = "rbxassetid://"..sound1
else if song == 2 then
music.SoundId = "rbxassetid://"..sound2
else if song == 3 then
music.SoundId = "rbxassetid://"..sound3
else if song == 4 then
music.SoundId = "rbxasset:"..sound4
else if song == 5 then
music.SoundID = "rbxasset:"..sound5
end
end
end
end
end
end
while true do
wait()
Song()
wait(.1)
music:Play()```
Thanks a bunch guys!
No it wouldn’t, but since I already made a script I will just give you the code:
local GenreFolder = game.Workspace:WaitForChild("Genre")--Store your songs as Sounds in a folder
local Folder = GenreFolder:WaitForChild("NewWave")
local Songs = Folder:GetChildren()
local RandomSong = Songs[math.random(1, #Songs)]
RandomSong:Play()
RandomSong.Ended:Wait()
while true do
for i, song in pairs(Songs) do
if song:IsA("Sound") then
song:Play()
song.Ended:Wait()
end
end
end