Music Gui Playing Issue

Yeah The parts I’ve Added in for it to work

Interesting, because this script works fine in my game. And I have an identical setup.

I would suggest moving the sound and parenting it under the GUI as that will 100% play.

1 Like

its in the same place as my music frame gui

SoundService should work just fine as long as the OP is using a Local script.

I’m thinking of what else it could be… maybe your button order is keeping this text button not on top? Does your cursor turn to a hand when u scroll over the text button?

A quick troubleshoot is to remove all elements except this text button, make it a simple GUI and see if maybe another element is interfering with the click detection.

I know your specialization is in UI, but just thinking out loud.

1 Like

It does turn into a hand after hovering over it even in studio

I tried this and it still didn’t work

SoundService probably is (not) the best way to do this, I recommend you use workspace. This script should work if you add your sound ID.

local SoundId = 000000
local Sound = Instance.new("Sound", workspace)
Sound.Name = "GoodSound"
Sound.SoundId = SoundId
Sound.Playing = false

script.Parent.MouseButton1Script:Connect(function()
    if Sound.Playing == true then
        Sound.Playing = false
        script.Parent.Text = "Mute Music"
    else
        Sound.Playing = true
        script.Parent.Text = "Play Music"
    end
end)

Keep in mind, that the new Roblox audio update only allows music you upload to be played in your game, so if you don’t own this audio asset, it just won’t work, which is your problem. (Again, only if you don’t own the audio asset, and it’s not on the marketplace for use by Roblox, or someone else.)

I did the stuff you said to do and the output says 2 things 1.

MouseButton1Script is not a valid member of TextButton “Players.3DRobloxGameDev.PlayerGui.Options.BooglesFrame.Music.Play”

Failed to load sound 9044420565: Unable to download sound data

And the audio is by the official Roblox account

Omg, I accidentally put MouseButton1Script- :joy:

Also, that error means you just can’t use that audio, it’s blocked for your use. Change MouseButton1Script to MouseButton1Down and find an audio that you can use. Sorry! :neutral_face:

No problem people make mistakes would I also put the music in the audio all audio I’m finding isn’t working even though its by Roblox

1 Like

No idea what you mean, but if you upload your own no copyright audio, (preferably from a site such as Epidemic Sound), you can take the ID from it, and add it to the variable SoundId!

The audio thing in workspace do I put the music Id in it in the properties

Ohh, the script will automatically generate it, so to make it work, you should add the audio to the SoundId variable, shown here:

local SoundId = 000000 -- Add the SoundId here!
local Sound = Instance.new("Sound", workspace)
Sound.Name = "GoodSound"
Sound.SoundId = SoundId
Sound.Playing = false

script.Parent.MouseButton1Down:Connect(function()
    if Sound.Playing == true then
        Sound.Playing = false
        script.Parent.Text = "Mute Music"
    else
        Sound.Playing = true
        script.Parent.Text = "Play Music"
    end
end)
1 Like

I’m getting a lot of failed to load because of the update and making music I’m afraid may get my account banned?

Ah, no worries, you’re fine; Roblox privated most of the audios, so the only reason you’re getting that error is because they can’t download the sound to your game. (In other words, you can’t use the audio.)

Your account is not going to be banned! :smile:

What audio will work because Roblox’s ones are just not working

If you upload your own, it will work. Just make sure it belongs to the group, or account your game is under!

Its strange why Roblox’s don’t work such a dumb issue but I forget it needs to be by the group or owner. And I don’t feel comfortable incase I do get banned because of Roblox’s moderation

1 Like