Hello guys. I was creating a menu for my server, but everytime that I call the DFrame that I created with vgui.Create("DFrame") I'm receiving:
[ERROR] addons/staticmanager/lua/manager/cl_menu.lua:4: attempt to index local 'FMenus' (a nil value)
1. unknown - addons/staticmanager/lua/manager/cl_menu.lua:4
2. include - [C]:-1
3. unknown - addons/staticmanager/lua/autorun/cl_init.lua:2
Here's my code:
[CODE]
local FMenus = vgui.Create("DFrame")
local PSMenus = vgui.Create("DPropertySheet", FMenus)
FMenus:SetSize(600, 400) -- Here's where my code gets wrong
FMenus:Center()
FMenus:ShowCloseButton(true)
FMenus:SetDraggable(false)
PSMenus:Dock(FILL)
PSMenus.Paginas = {}
FMenus:MakePopup()
function FMenus:Paint()
end
[/CODE]
I don't know why I'm receiving this, because everytime I created a DFrame I made by this way.
Maybe you're running this code server-side?
[b]unknown - addons/staticmanager/lua/autorun/cl_init.lua:2[/b] this is shared files location
EDIT: why dumb?
[QUOTE=iJohnny;51543587]Maybe you're running this code server-side?
[b]unknown - addons/staticmanager/lua/autorun/cl_init.lua:2[/b] this is shared files location
EDIT: why dumb?[/QUOTE]
vgui would be nil, and the error would be on the first line for attempting to index it.
Your code is probably running too early. Try putting it in InitPostEntity or something.
[QUOTE=NeatNit;51546109]Your code is probably running too early. Try putting it in InitPostEntity or something.[/QUOTE]
Thanks man, problem solved!
Sorry, you need to Log In to post a reply to this thread.