Sound=script.Parent GuiTarget=script.Parent.Parent ButtonBindings={}function TryBindButton(l)if l:IsA("\071\117\105\066\117\116\116\111\110")then ButtonBindings[l]=l.MouseButton1Down:Connect(function()Sound:Play()end)end end for l,c in ipairs(GuiTarget:GetDescendants())do TryBindButton(c)end GuiTarget.DescendantAdded:Connect(TryBindButton)GuiTarget.DescendantRemoving:Connect(function(l)if ButtonBindings[l]~=nil then ButtonBindings[l]:Disconnect()ButtonBindings[l]=nil end end)


Sound = script.Parent
GuiTarget = script.Parent.Parent
ButtonBindings = {} -- A table of MouseButton1Down connections indexed by their buttons.

function TryBindButton(object)
	if object:IsA("GuiButton") then
		ButtonBindings[object] = object.MouseButton1Down:Connect(function()
			Sound:Play()
		end)
	end
end
for i, item in ipairs(GuiTarget:GetDescendants()) do
	TryBindButton(item)
end
GuiTarget.DescendantAdded:Connect(TryBindButton)
GuiTarget.DescendantRemoving:Connect(function(object)
	if ButtonBindings[object] ~= nil then
		ButtonBindings[object]:Disconnect()
		ButtonBindings[object] = nil
	end
end)
