So i took a long break from Lua, went on to program in C#, then C and C++ a little.
Anyhow, i’m jumping back into the Lua scene. I’m trying to learn the ropes again and make a gamemode.
I copied a VGUI function that makes a DFrame. However, when the script is run i get an error or warning that “vgui” in “vgui.Create()” is a nil value.
Because i’ve been here before, i used Lua_Run in the console and ran my vgui function, and it painted the window normally.
I linked the function, which is run and linked to a ConCommand inside a file included by cl_init.lua, which is then run in GM:PlayerInitialSpawn (inside init.lua).
My question is, why does it see this as nil? Is it the concommand being run in init.lua? And if its nil as it says, why does it function correctly?
After a little modification, the panel is created within the cl_init file.
However, the error still remains.
Was there a memo i didn’t get?