derma error on inital server load

So I created another file specifically for a derma menu I’ve been working on in a a test gamemode folder and upon launch , although the derma loads perfectly fine , I’m getting this error with the initial load of the server . Here’s the error:



[ERROR] gamemodes/lobbygamemode/gamemode/cl_modellist.lua:4: attempt to index global 'vgui' (a nil value)
  1. unknown - gamemodes/lobbygamemode/gamemode/cl_modellist.lua:4
   2. include - [C]:-1
    3. unknown - gamemodes/lobbygamemode/gamemode/init.lua:9

Here’s a snippet of the code:


AddCSLuaFile("cl_init.lua")

local ModelList = vgui.Create("DPanel")
ModelList:SetPos(ScrW()/5, ScrH()/5)
ModelList:SetSize(710,750)
ModelList:SetVisible(true)
ModelList:MakePopup()
	ModelList.Paint = function(self, w, h)
		draw.RoundedBox(0,0,0,w,h,Color(41,128,185,255))
	end

Any help is greatly appreciated

you are loading your cl_ file on server.

oh woops :stuck_out_tongue: thanks for the help! fixed it