SFX Button Issues

Hi! Currently I am trying to make a button that mutes all sound effects in the game (besides music). Some of these sound effects are implemented into scripts as an asset id, while others are able to be directly seen in the explorer with the Sound ClassName. However, since I’m complete dog at coding, it doesn’t work. Here are all the resources you need if you want to help me.

local button = script.Parent
local Sound = game.Workspace.Sound
local Sound1 = game.StarterGui.Sound
local Sound2 = game.ReplicatedStorage.Sound
local Sound3 = game.StarterCharacterScripts.Sound
local OG = Sound.Volume
button.MouseButton1Click:Connect(function()
	if button.Text == "ON" then
		button.Text = "OFF"
		Sound.Volume = 0
		Sound1.Volume = 0
		Sound2.Volume = 0
		Sound3. Volume = 0
	else
		button.Text = "ON"
		Sound.Volume = OG
	end
end)

(This script is in ON/OFF1)
image


(This is in Button Change)

1 Like