Guys how can i do a music gui

Also local button should = script.Parent, not MouseButton1Click

I don’t know if I did it wrong but it doesn’t work so I’d like to share the script and see if I made a mistake


cupid

It is my bad, add another end on that second image. It should have 2, not one.

Your still using Numbers as the Image Id so make sure you still convert them as seen here in my post above :slight_smile:

1 Like


it’s is correct ?

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