Problems with DCollapsibleCategory


I’m making a menu for RP purposes using DCollapsableCategory.

I basically want it to work similar to the tool menu in the Q menu. I can make it work with 2 collapsible categories but unable to make it work with the 3rd. Line 222 is where it manages how the categories move.

I get the error

lua\autorun\client\cl_gui.lua:234: attempt to index global 'CookCategory' (a nil value)

-snip code-
If anyone could help me I would really appreciate it.

You havn’t local’d CookCategory.

I don’t think it is that though…
Just a shot in the dark

local CookCategory = vgui.Create("DCollapsibleCategory", MainList)  

Yes I have? Unless you’re talking about something else.

CookCategory is local. You should local everything, there is nothing in your code that needs to be global.

Sorry Mickyyismick, I looked at CookCategoryList.

But what MakeR said, nothing about a Derma Panel should be global

So does something need ‘localising’ or not?

Everything needs localising

(Not literally everything, just the lines of code with “vgui.Create” after it)

I think it’s working now however it cuts off.

e; All fixed, was a problem with the spacing. Had to set it again. Thanks for all your help.