Hello there. I’m new to Gmod Lua scripting, although not new to the Lua language itself. I’ve been going through the Lua tutorials on the official wiki, and I’ve become stuck on this one: http://wiki.garrysmod.com/page/Derma_Basic_Guide
Specifically, I’m stuck on the DFrame. Since I’ve had quite a good run with the Chair Thrower tutorial (and even made some heavy and interesting modifications!) I was confident with this tutorial and tried to make a toggleable derma via concommand. It turned out not working, for reasons I’m sure have to do with my misunderstanding. So, I decided to just use the code they provided to find out how it worked, and run it by lua_openscript (only their code, I didn’t add anything or remove anything). It gave me this error:
[ERROR] lua/dermatest.lua:3: attempt to index global ‘vgui’ (a nil value)
- unknown - lua/dermatest.lua:3
I was a bit confused. I tried running it multiple times, in case vgui just took a while to initialize or something. Same error every time. Tried reloading, rechecked that it was the exact code the derma guide provided, and I still get it. So, then I tried instead to narrow down what the issue was, by checking from the beginning if vgui “exists”. From my tests, it seems to be telling me it “doesn’t exist”, and I can’t create the panel at all. The code I am using is the exact DFrame code provided on the guide I linked to above. Am I doing something wrong?
I am willing to provide as much information as I can regarding the problem. Thank you in advance for any help, and I hope it’s not something horribly dumb I overlooked. :downs: