Attempt to index nil with 'connect'

I tried using topbar plus, and it doesnt work for some reason

local Icon = require(game:GetService("ReplicatedStorage").Icon)
local icon = Icon.new()
local muted = false
local sound = game.StarterGui.MusicSystem.Sound

icon.MouseButton1Click:connect(function()
	if muted then
		sound.Volume = 0.2
		muted = false
		Icon.new()
		:setImage(4882429582)
		:setLabel("Mute", "deselected")
	else
		sound.Volume = 0
		muted = true
		Icon.new()
		:setImage(4780415369)
		:setLabel("Unmute", "selected")
	end
end)

can anyone help?

instead of icon.MouseButton1Click, use
icon.selected and icon.deselected or icon.toggled