Prop Hunt: Mute button for scoreboard

I’m familiar on the ply:mute but not so much on how to make button guis. So the commands I want to call are…

function IgnorePlayer(ply)
function UnignorePlayer(ply)

This should allow me to toggle muting for clients, however can I get some help creating a button that will do that?

How would I go about making a button and attaching it to the scoreboard?

You may want to take a look into garrysmod/garrysmod/gamemodes/base/cl_scoreboard.lua. I used Garry’s method for the mute button to add it to my own scoreboard.

First he creates the image button in PANEL:Init()

self.Mute = self:Add( "DImageButton" )
self.Mute:SetSize( 32, 32 )
self.Mute:Dock( RIGHT )

In PANEL:Think() he checks the current mute state of the player:

-- Change the icon of the mute button based on state
if ( self.Muted == nil || self.Muted != self.Player:IsMuted() ) then
        self.Muted = self.Player:IsMuted()
        if ( self.Muted ) then
		self.Mute:SetImage( "icon32/muted.png" )
		self.Mute:SetImage( "icon32/unmuted.png" )

	self.Mute.DoClick = function() self.Player:SetMuted( !self.Muted ) end