So, I made a button that mutes in-game music if clicked...well...it's supposed to, anyways. The BUTTON works, but the function doesn't. I have a feeling I need to remake the script that mutes music. Any tips? Thanks!
Here's the script.
local Gui = script.Parent local Player = script.Parent.Parent.Parent local button = script.Parent.MouseButton1Clicked local Char = Player.Character Gui.ButtonMouse1Clicked:connect(button) function button () ToggleMute () end ToggleMute = Gui.MouseButton1Clicked:connect()
p = game.Players.LocalPlayer sound = p.Backpack:WaitForChild("LobbyMusic") script.Parent.MouseButton1Click:connect(function() if sound.Volume == 1 then sound.Volume = 0 else sound.Volume = 1 end end)
Here is a extremely simple script I made awhile ago. Add the music to the StarterPack and change the name on line 2 where it says "LobbyMusic" to whatever the name of the sound is called.
Replace this script with your current. Make sure you are using a localscript