How to make a MUSIC PLAYLIST | Roblox Studio (RANDOMISER + MUTE BUTTON)

Published: 11 July 2024
on channel: Itz_FloppyFish
14,634
530

In todays video I show you how to make a music playlist! In this video I also show you how to make the music play randomly and also how to add a MUTE button to allow the player to mute the music while playing the game. I created this video aimed to allow you to customize it to how you like, no matter what sort of style you are wanting in your game. I also fully explain the code, explaining, why, how and when we use specific parts of the code. This video is amazing if your wanting to learn more about coding! Music playlists are often used in games to give players that extra boost and mood, enhancing the overall player experience. So, if you want to add this type of system to your game, make sure to watch until the end of the video to find out how!

I really enjoy making these videos for you all so I hope you enjoy them just as much as I do!
Have a lovely rest of your day!

NEW FLOPPY MERCH STORE: https://itzfloppyfish.myshopify.com/
NEW FLOPPY GAME: https://www.roblox.com/games/16991710...

00:00 - Introduction
00:12 - Find your Music
4:34 - Script 1 (Normal Playlist)
9:34 - Script 2 (Random Playlist)
12:42 - Mute Button
17:40 - Outro

Script 1 (Normal Standard Playlist):

local SoundGroup = game.SoundService.SoundGroup -- Change SoundGroup to whatever you named your SoundGroup
local Playlist = {
Sound1 = SoundGroup.Sound1, -- Change sound name accordingly
Sound2 = SoundGroup.Sound2,
Sound3 = SoundGroup.Sound3,-- Change sound name accordingly
-- Add more sounds if needed
}

local function PlaySound(Sound)
Sound:Play()
Sound.Ended:Wait()
end

while true do
for _, Sound in pairs(Playlist) do
PlaySound(Sound)
wait(2) -- The wait time between songs
end
end
-----------------------

Script 2 (Random Playlist):

local SoundGroup = game.SoundService.SoundGroup -- Change SoundGroup to whatever you named your SoundGroup
local Playlist = {
SoundGroup.Sound1,
SoundGroup.Sound2,
SoundGroup.Sound3,
-- Add more sounds if needed
}

local function PlayRandomSound()
local randomIndex = math.random(1, #Playlist)
local Sounds = Playlist[randomIndex]

if Sounds then
Sounds:Play()
Sounds.Ended:Wait()
end
end

while true do
PlayRandomSound()
wait(2) -- The wait time between songs
end
---------------

Script 3 (Mute Button):

script.Parent.Text = "Mute" -- The initial text when the game loads
local PlaylistActive = false
local MusicSoundGroup = game:GetService("SoundService").SoundGroup -- Change SoundGroup to whatever your SoundGroup is called

script.Parent.MouseButton1Click:Connect(function()
if not PlaylistActive then
MusicSoundGroup.Volume = 0
script.Parent.Text = "Unmute"
PlaylistActive = true
else
MusicSoundGroup.Volume = 0.5 -- This is the volume of the audio when they turn it back on
script.Parent.Text = "Mute"
PlaylistActive = false
end
end)
----------------------------
If you are a bit confused what to do, Feel free to create a ticket in my discord server and we can help you out!

Floppys Games:

Obby but your a fish: https://www.roblox.com/games/14917960...
Fish Magnet Simulator: https://www.roblox.com/games/13963457...
The never ending road: https://www.roblox.com/games/11301003...
Floppys Hangout: https://www.roblox.com/games/73197484...

If you would like to support me even more, Super Thanks and becoming a Member is also another way to show your appreciation!

🌟 Floppys Discord Server:   / discord  

Roblox Studio Tutorial
Roblox Studio
Studio Tutorials


Watch video How to make a MUSIC PLAYLIST | Roblox Studio (RANDOMISER + MUTE BUTTON) online without registration, duration hours minute second in high quality. This video was added by user Itz_FloppyFish 11 July 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 14,634 once and liked it 530 people.