I goofed up on my glua

Hey so, I goofed up and my addon when I type in the chat command it pops up the GUI for everyone.



if CLIENT then

function DankMemes()

local frame = vgui.Create("DFrame")
frame:SetSize( 1200, 600 )
frame:Center()
frame:SetVisible( true )
frame:MakePopup()
frame:SetTitle( "        Node Core" )
frame:ShowCloseButton( false )
frame:SetSizable( false )
frame.Paint = function( self, w, h )
	draw.RoundedBox( 30, 0, 0, w, h, Color( 21, 76, 230, 150 ))
end

local panel = vgui.Create("DPanel", frame)
panel:Dock(FILL)
panel:DockMargin(-5, -5, -5, -5)

local text = vgui.Create("DLabel", panel)
text:SetSize(300, 50)
text:SetPos(10, 0)
text:SetTextColor(Color(33, 33, 33))
text:SetText("          Enabling Node Core can dramatically increase fps.")

local ybtn = vgui.Create("DButton", panel)
ybtn:SetText("Enable")
ybtn:SetPos(100, 45)
ybtn:SetSize(100, 25)
ybtn:SetTextColor(Color(0, 0, 255))

local nbtn = vgui.Create("DButton", panel)
nbtn:SetText("Disable")
nbtn:SetPos(100, 75)
nbtn:SetSize(100, 25)
nbtn:SetTextColor(Color(255, 0, 0))

local xbtn = vgui.Create("DButton", panel)
xbtn:SetText("X")
xbtn:SetPos(1170, 10)
xbtn:SetSize(25, 25)
xbtn:SetTextColor(Color(255, 0, 0))

local cbtn = vgui.Create("DButton", panel)
cbtn:SetText("+ 5$")
cbtn:SetPos(1000, 100)
cbtn:SetSize(100, 100)
cbtn:SetTextColor(Color(0, 0, 0))

function ybtn:Paint(w, h)
draw.RoundedBox(3, 0, 0, w, h, Color(255, 255, 255, 255))
end

function nbtn:Paint(w, h)
draw.RoundedBox(3, 0, 0, w, h, Color(255, 255, 255, 255))
end

function xbtn:Paint(w, h)
draw.RoundedBox(3, 0, 0, w, h, Color(255, 0, 0, 155))
end

function cbtn:Paint(w, h)
draw.RoundedBox(3, 0, 0, w, h, Color(255, 255, 255, 155))
end

ybtn.DoClick = function()
LocalPlayer():ConCommand("gmod_mcore_test 1")
LocalPlayer():ConCommand("mat_queue_mode -1")
LocalPlayer():ConCommand("cl_threaded_bone_setup 1")
LocalPlayer():ConCommand("cl_threaded_client_leaf_system 1")
LocalPlayer():ConCommand("r_threaded_particles 1")
LocalPlayer():ConCommand("r_threaded_renderables 1")
LocalPlayer():ConCommand("r_queued_ropes 1")
LocalPlayer():ConCommand("studio_queue_mode 1")
end

nbtn.DoClick = function()
LocalPlayer():ConCommand("gmod_mcore_test 0")
LocalPlayer():ConCommand("mat_queue_mode 0")
LocalPlayer():ConCommand("cl_threaded_bone_setup 0")
LocalPlayer():ConCommand("cl_threaded_client_leaf_system 0")
LocalPlayer():ConCommand("r_threaded_particles 0")
LocalPlayer():ConCommand("r_threaded_renderables 0")
LocalPlayer():ConCommand("r_queued_ropes 0")
LocalPlayer():ConCommand("studio_queue_mode 0")
end

xbtn.DoClick = function()
frame:Remove()
end

cbtn.DoClick = function()
DankMoney()
end

end

hook.Add( "OnPlayerChat", "UNIQUEIDENT", function( ply, str, bteam, bdead )

	str = string.lower( str )
	
	if( str == "!gui" ) then
		DankMemes()
	end
	end)

end

function DankMoney( ply )
	ply:AddMoney(5)
end


OnPlayerChat gets called whenever ANY player chats, so this will stop it from happening:



hook.Add( "OnPlayerChat", "UNIQUEIDENT", function( ply, str, bteam, bdead )

    if ply ~= LocalPlayer() then return end
    
    -- more code stuff here


Also, what is this about:



frame:SetTitle( "        Node Core" )


Please fix:



frame:SetTitle( "Node Core" )


Also, please make your functions local



local function DankMemes()




local function DankMoney( ply )


I need the spaces because of the curve, the name appears outside without the spaces.