Help with muting music

You should try using :FindFirstChild(), instead of :WaitForChild()

You can do one more thing, switch the 0 and 0.5 to .5 and 0

fixed an extra action which means the script is now almost fixed,however a new error was sent

Players.Cypacic.PlayerGui.Settings.Frame.Mute.Actions:21: attempt to index nil with 'Volume'

Oh, here we go. You didn’t clone and parented the music to workspace. That’s the problem

Okay, have you tried this exact script?

local music = -- Path to Music

local db = true

script.Parent.MouseButton1Click:Connect(function()

if db == true and music then

db = false

script.Parent.Text = ("Unmute Music")

music.Volume = 0

else

db = true

script.Parent.Text = ("Mute Music")

music.Volume = 0.5

end

end)

Can you explain briefly?
I’m don’t understand what you mean.

This doesn’t work,not even the Text changes

Wdym clone?
I duplicate it?
I don’t understand

I don’t think anyone mentioned it, but I don’t think you set the debounce back to true after.

Use wait for child when referencing the music in Rep storage. I think the music variable is equal to nil

Dude just add a string Value inside a player and make this variable a string value so its Value will be the current music ongoing
Make a script that when clicking button, it searches for the music name by the string value and makes the volume = 0

Its hard to explain here on text but i hope u get it

Changed wait for child to FindFirstChild then half the script worked…

You’re correct,I don’t understand a thing but it’ll try to

I don’t understand by what you mean…
Sorry

At the end you should make the debounce true, so it can still work again

local music = -- Path to Music

local db = true

script.Parent.MouseButton1Click:Connect(function()

if db and music then

db = false

script.Parent.Text = ("Unmute Music")

music.Volume = 0

else

db = false

script.Parent.Text = ("Mute Music")

music.Volume = 0.5

end
wait(1)
db = true
end)

Players.Cypacic.PlayerGui.Settings.Frame.Mute.Actions:21: attempt to index nil with 'Volume'

What is the script in the line 21?

line 21 is music.Volume = 0.5

Ima check in studio. Will come back in a bit.

Can I see what you put in ReplicatedStorage?

Edit: No need to send it anymore