Guys how can i do a music gui

The images? As far as I’m aware yes. is it not working for you?

Sorry a mistake I made that is visible on line vingt-huit was forgetting to set songmuted to true, so start a new line there which states songmuted = true

it’s not working fort me idk if i did it wrong or it’s just the script don’t work

Can you post an image of the console or output when you test the game?

sure

Is sound1 playing?

and did you make this change? Guys how can i do a music gui - #22 by 700000002

Also, please show a screenshot of the musicfolder in the Explorer.

ye he is playing and no i didn’t make this change

how i can create a music folder in explorer ?

There are differeny ways to do this.

I would hover over Workspace in the explorer and flick the “+” icon

Then I would find the “Folder” or perhaps “Dossier” object

Then rename the dossier “songs”

All the sounds should be located in there

Screenshot 2023-08-05 134502

where i can place it ? because there are too many of lines lol

it is correct ? now because it doesn’t work

Oh ok, I’ve noticed a few things. For me to fix them, please copy-and-paste the entire script into a reply, then send me a screenshot of the folder in explorer

local musicfolder = game.Workspace:WaitForChild(“songs”) – place a folder into workspace. Add three UNLOOPED sounds into the folder named “sound1”, “sound2”, and “sound3”.
– Set only sound1’s isPlaying property to true

local songnumber = musicfolder.song – insert an intvalue into the folder called “song”. Set the value to 1
local button = script.Parent
local songvolume = 1 – replace with the volume you’d like the song to be

local songmuted = false

local function mute()
for i, v in pairs(musicfolder:GetChildren()) do
if v.Playing == true then
v.Playing = false
songmuted = false
end
end
if songmuted == false then
for i, v in pairs(musicfolder:GetChildren()) do
if v:IsA(“Sound”) then
v.Volume = 0
end
end
button.Image = “rbxassetid://299432408” – replace with the imageid
else
local songtoplay = musicfolder:FindFirstChild(“sound”…songnumber.Value)
if songtoplay == nil then return end
songtoplay.Volume = songvolume
button.Image = “rbxassetid://299432422”
end
end

local function changeSong()
if songnumber.Value == 1 then
musicfolder.sound2:Play()
songnumber.Value = 2
else
if songnumber.Value == 2 then
musicfolder.sound3:Play()
songnumber.Value = 3
else
if songnumber.Value == 3 then
musicfolder.sound1:Play()
songnumber.Value = 1
end
end
end
end

button.MouseButton1Down:Connect(mute)

musicfolder.sound1.Ended:Connect(changeSong)
musicfolder.sound2.Ended:Connect(changeSong)
musicfolder.sound3.Ended:Connect(changeSong)

image

1 Like

The folder is mostly good, but you need to insert an IntValue into the folder by hovering over it and pressing plus, then find intvalue and insert it. After that, change the intvalue’s value to 1. Rename the IntValue “song”

Now delete all the text in the script and paste this updated script:

local musicfolder = game.Workspace:WaitForChild("songs") -- place a folder into workspace. Add three UNLOOPED sounds into the folder named "sound1", "sound2", and "sound3". 
-- Set only sound1's isPlaying property to true

local songnumber = musicfolder.song -- insert an intvalue into the folder called "song". Set the value to 1
local button = script.Parent
local songvolume = 0.8 -- replace with the volume you'd like the song to be
local MuteImage, UnMuteImage = "muteimageid", "unmuteimageid"
local songmuted = false

local function PreLoadMuteImages() 
	game:GetService("ContentProvider"):PreloadAsync({ MuteImage, UnMuteImage })
	print("Done Loading")
end
coroutine.wrap(PreLoadMuteImages)()
local function mute()
	for i, v in pairs(musicfolder:GetChildren()) do
		if v.Volume ~= 0 then
			songmuted = false
		end
	end
	if songmuted == false then
		for i, v in pairs(musicfolder:GetChildren()) do
			if v:IsA("Sound") then
				v.Volume = 0
			end
		end
		button.Image = UnMuteImage
		songmuted = true
	else
		local songtoplay = musicfolder:FindFirstChild("sound"..songnumber.Value)
		if songtoplay == nil then return end
		songtoplay.Volume = songvolume
		button.Image = MuteImage
		songmuted = false
	end
end


local function changeSong()
	if musicfolder:FindFirstChild("sound"..songnumber.Value) then
		musicfolder:FindFirstChild("sound"..songnumber.Value):Play()
		songnumber.Value += 1
	else
		musicfolder:FindFirstChild("sound1"):Play()
		songnumber.Value = 1
	end
end


button.MouseButton1Down:Connect(mute)


for i, v in musicfolder:GetChildren() do 
	if v:IsA("Sound") then 
		v.Ended:Connect(changeSong)
	end
end

Devforum is not a place for people to make scripts and/or assets for you. It is meant to help, not get free work.

1 Like

This is a good point, next time Capitain_Lefty can post a script which can be improved upon, rather than nil

i don’t know why it does not work and i did everything

and I wonder if there’s anything to change with that?
image