attempt to index global 'vgui' (a nil value)

I am trying to get a menu to pull up through the F1 key, which works because it calls up my function from cl_init.lua, but I keep getting the same error every time. “attempt to index global ‘vgui’ (a nil value)”. Even when I remove the part that is included in the error, it just shifts down to the next part of the vgui, telling me the same error. I looked it up on the wiki, and the definition is too vague for me to understand. Here is my cl_init.lua:

include( “shared.lua” )

function set_team()

gui.EnableScreenClicker( true )

local DLabel18 = vgui.Create(‘DLabel’)
DLabel18:SetPos(505, 405)
DLabel18:SetText(‘Check enemy positions’)
DLabel18:SizeToContents()

DLabel17 = vgui.Create(‘DLabel’)
DLabel17:SetPos(505, 425)
DLabel17:SetText(’$2,000’)
DLabel17:SizeToContents()

DLabel16 = vgui.Create(‘DLabel’)
DLabel16:SetPos(505, 385)
DLabel16:SetText(‘UAV’)
DLabel16:SizeToContents()

DLabel15 = vgui.Create(‘DLabel’)
DLabel15:SetPos(505, 335)
DLabel15:SetText(‘Sets health to 100’)
DLabel15:SizeToContents()

DLabel14 = vgui.Create(‘DLabel’)
DLabel14:SetPos(505, 355)
DLabel14:SetText(’$1,000’)
DLabel14:SizeToContents()

DLabel13 = vgui.Create(‘DLabel’)
DLabel13:SetPos(505, 315)
DLabel13:SetText(‘MedPak’)
DLabel13:SizeToContents()

DLabel12 = vgui.Create(‘DLabel’)
DLabel12:SetPos(505, 265)
DLabel12:SetText(‘For RPGs only’)
DLabel12:SizeToContents()

DLabel11 = vgui.Create(‘DLabel’)
DLabel11:SetPos(505, 285)
DLabel11:SetText(’$700’)
DLabel11:SizeToContents()

DLabel10 = vgui.Create(‘DLabel’)
DLabel10:SetPos(505, 245)
DLabel10:SetText(‘Rockets’)
DLabel10:SizeToContents()

DLabel9 = vgui.Create(‘DLabel’)
DLabel9:SetPos(505, 195)
DLabel9:SetText(‘For shotguns only’)
DLabel9:SizeToContents()

DLabel8 = vgui.Create(‘DLabel’)
DLabel8:SetPos(505, 215)
DLabel8:SetText(’$450’)
DLabel8:SizeToContents()

DLabel7 = vgui.Create(‘DLabel’)
DLabel7:SetPos(505, 175)
DLabel7:SetText(‘Shotgun Ammo’)
DLabel7:SizeToContents()

DLabel6 = vgui.Create(‘DLabel’)
DLabel6:SetPos(505, 125)
DLabel6:SetText(‘For pistols only’)
DLabel6:SizeToContents()

DLabel5 = vgui.Create(‘DLabel’)
DLabel5:SetPos(505, 145)
DLabel5:SetText(’$400’)
DLabel5:SizeToContents()

DLabel4 = vgui.Create(‘DLabel’)
DLabel4:SetPos(505, 105)
DLabel4:SetText(‘Pistol Ammo’)
DLabel4:SizeToContents()

DLabel3 = vgui.Create(‘DLabel’)
DLabel3:SetPos(505, 55)
DLabel3:SetText(‘For rifles only’)
DLabel3:SizeToContents()

DLabel2 = vgui.Create(‘DLabel’)
DLabel2:SetPos(505, 75)
DLabel2:SetText(’$500’)
DLabel2:SizeToContents()

DLabel1 = vgui.Create(‘DLabel’)
DLabel1:SetPos(505, 35)
DLabel1:SetText(‘Rifle Ammo’)
DLabel1:SizeToContents()

DImageButton6 = vgui.Create(‘DImageButton’)
DImageButton6:SetSize(50, 50)
DImageButton6:SetPos(450, 385)
DImageButton6:SetImage(‘models/weapons/w_hands.mdl’)
DImageButton6:SizeToContents()
DImageButton6.DoClick = function()
RunConsoleCommand( “give_uav” )
RunConsoleCommand( “clear_menu” )
end
DImageButton6.DoRightClick = function() end

DImageButton5 = vgui.Create(‘DImageButton’)
DImageButton5:SetSize(50, 50)
DImageButton5:SetPos(450, 315)
DImageButton5:SetImage(‘models/weapons/w_bugbait.mdl’)
DImageButton5:SizeToContents()
DImageButton5.DoClick = function()
RunConsoleCommand( “give_medpak” )
RunConsoleCommand( “clear_menu” )
end
DImageButton5.DoRightClick = function() end

DImageButton4 = vgui.Create(‘DImageButton’)
DImageButton4:SetSize(50, 50)
DImageButton4:SetPos(450, 245)
DImageButton4:SetImage(‘models/weapons/w_RPG.mdl’)
DImageButton4:SizeToContents()
DImageButton4.DoClick = function()
RunConsoleCommand( “give_rockets” )
RunConsoleCommand( “clear_menu” )
end
DImageButton4.DoRightClick = function() end

DImageButton3 = vgui.Create(‘DImageButton’)
DImageButton3:SetSize(50, 50)
DImageButton3:SetPos(450, 175)
DImageButton3:SetImage(‘models/weapons/w_shotgun.mdl’)
DImageButton3:SizeToContents()
DImageButton3.DoClick = function()
RunConsoleCommand( “give_shotgunammo” )
RunConsoleCommand( “clear_menu” )
end
DImageButton3.DoRightClick = function() end

DImageButton2 = vgui.Create(‘DImageButton’)
DImageButton2:SetSize(50, 50)
DImageButton2:SetPos(450, 105)
DImageButton2:SetImage(‘models/weapons/w_Pistol.mdl’)
DImageButton2:SizeToContents()
DImageButton2.DoClick = function()
RunConsoleCommand( “give_pistolammo” )
end
DImageButton2.DoRightClick = function() end

DImageButton1 = vgui.Create(‘DImageButton’)
DImageButton1:SetSize(50, 50)
DImageButton1:SetPos(450, 35)
DImageButton1:SetImage(‘models/weapons/w_IRifle.mdl’)
DImageButton1:SizeToContents()
DImageButton1.DoClick = function()
RunConsoleCommand( “give_rifleammo” )
RunConsoleCommand( “clear_menu” )
end
DImageButton1.DoRightClick = function() end

DPanel6 = vgui.Create(‘DPanel’)
DPanel6:SetSize(175, 60)
DPanel6:SetPos(445, 380)

DPanel5 = vgui.Create(‘DPanel’)
DPanel5:SetSize(175, 60)
DPanel5:SetPos(445, 310)

DPanel4 = vgui.Create(‘DPanel’)
DPanel4:SetSize(175, 60)
DPanel4:SetPos(445, 240)

DPanel3 = vgui.Create(‘DPanel’)
DPanel3:SetSize(175, 60)
DPanel3:SetPos(445, 170)

DPanel2 = vgui.Create(‘DPanel’)
DPanel2:SetSize(175, 60)
DPanel2:SetPos(445, 100)

DPanel1 = vgui.Create(‘DPanel’)
DPanel1:SetSize(175, 60)
DPanel1:SetPos(445, 30)

DFrame1 = vgui.Create(‘DFrame’)
DFrame1:SetSize(185, 445)
DFrame1:SetPos(440, 0)
DFrame1:SetTitle(‘Shop’)
DFrame1:SetSizable(true)
DFrame1:SetDeleteOnClose(false)
DFrame1:MakePopup()

DButton11 = vgui.Create(‘DButton’)
DButton11:SetSize(95, 35)
DButton11:SetPos(0, 400)
DButton11:SetText(‘Mage’)
DButton11.DoClick = function()
RunConsoleCommand( “team_12” )
RunConsoleCommand( “clear_menu” )
end

DButton10 = vgui.Create(‘DButton’)
DButton10:SetSize(95, 35)
DButton10:SetPos(0, 320)
DButton10:SetText(‘Terrorist’)
DButton10.DoClick = function()
RunConsoleCommand( “team_10” )
RunConsoleCommand( “clear_menu” )
end

DButton9 = vgui.Create(‘DButton’)
DButton9:SetSize(95, 35)
DButton9:SetPos(0, 360)
DButton9:SetText(‘UnDead’)
DButton9.DoClick = function()
RunConsoleCommand( “team_11” )
RunConsoleCommand( “clear_menu” )
end

DButton8 = vgui.Create(‘DButton’)
DButton8:SetSize(95, 35)
DButton8:SetPos(0, 280)
DButton8:SetText(‘CT’)
DButton8.DoClick = function()
RunConsoleCommand( “team_9” )
RunConsoleCommand( “clear_menu” )
end

DButton7 = vgui.Create(‘DButton’)
DButton7:SetSize(95, 35)
DButton7:SetPos(0, 240)
DButton7:SetText(‘Samurai’)
DButton7.DoClick = function()
RunConsoleCommand( “team_8” )
RunConsoleCommand( “clear_menu” )
end

DButton6 = vgui.Create(‘DButton’)
DButton6:SetSize(95, 35)
DButton6:SetPos(0, 200)
DButton6:SetText(‘The Goods’)
DButton6.DoClick = function()
RunConsoleCommand( “team_6” )
RunConsoleCommand( “clear_menu” )
end

DButton5 = vgui.Create(‘DButton’)
DButton5:SetSize(95, 35)
DButton5:SetPos(0, 160)
DButton5:SetText(‘FrontLiner’)
DButton5.DoClick = function()
RunConsoleCommand( “team_5” )
RunConsoleCommand( “clear_menu” )
end

DButton4 = vgui.Create(‘DButton’)
DButton4:SetSize(95, 35)
DButton4:SetPos(0, 120)
DButton4:SetText(‘MaskedExplosive’)
DButton4.DoClick = function()
RunConsoleCommand( “team_4” )
RunConsoleCommand( “clear_menu” )
end

DButton3 = vgui.Create(‘DButton’)
DButton3:SetSize(95, 35)
DButton3:SetPos(0, 80)
DButton3:SetText(‘SpeedSpecial’)
DButton3.DoClick = function()
RunConsoleCommand( “team_3” )
RunConsoleCommand( “clear_menu” )
end

DButton2 = vgui.Create(‘DButton’)
DButton2:SetSize(95, 35)
DButton2:SetPos(0, 40)
DButton2:SetText(‘HeavyRocket’)
DButton2.DoClick = function()
RunConsoleCommand( “team_2” )
RunConsoleCommand( “clear_menu” )
end

DButton1 = vgui.Create(‘DButton’)
DButton1:SetSize(95, 35)
DButton1:SetPos(0, 0)
DButton1:SetText(‘SlickSniper’)
DButton1.DoClick = function()
RunConsoleCommand( “team_1” )
RunConsoleCommand( “clear_menu” )
end
function clear_menu( ply )
DLabel18:SetVisible( false )
DLabel17:SetVisible( false )
DLabel16:SetVisible( false )
DLabel15:SetVisible( false )
DLabel14:SetVisible( false )
DLabel13:SetVisible( false )
DLabel12:SetVisible( false )
DLabel11:SetVisible( false )
DLabel10:SetVisible( false )
DLabel9:SetVisible( false )
DLabel8:SetVisible( false )
DLabel7:SetVisible( false )
DLabel6:SetVisible( false )
DLabel5:SetVisible( false )
DLabel4:SetVisible( false )
DLabel3:SetVisible( false )
DLabel2:SetVisible( false )
DLabel1:SetVisible( false )
DImageButton6:SetVisible( false )
DImageButton5:SetVisible( false )
DImageButton4:SetVisible( false )
DImageButton3:SetVisible( false )
DImageButton2:SetVisible( false )
DImageButton1:SetVisible( false )
DPanel6:SetVisible( false )
DPanel5:SetVisible( false )
DPanel4:SetVisible( false )
DPanel3:SetVisible( false )
DPanel2:SetVisible( false )
DPanel1:SetVisible( false )
DFrame1:SetVisible( false )
DButton11:SetVisible( false )
DButton10:SetVisible( false )
DButton9:SetVisible( false )
DButton8:SetVisible( false )
DButton7:SetVisible( false )
DButton6:SetVisible( false )
DButton5:SetVisible( false )
DButton4:SetVisible( false )
DButton3:SetVisible( false )
DButton2:SetVisible( false )
DButton1:SetVisible( false )
gui.EnableScreenClicker(false)
end
concommand.Add( “clear_menu”, clear_menu )
end
concommand.Add( “Menu”, set_team )

Any help is appreciated, and this may be a very simple fix, but I am at my wits end of trying new things out and getting no results. D:

You are calling it server-side. The vgui library only exists client-side.

You are including cl_init.lua serverside.