Straight to the point. How would i create a spawnmenu that comes up when i push Q. I have no idea how to start and have messed around with functions such as GM:OnSpawnMenuOpen() but still cannot figure out how it is done. Any help will be much appreciated.
I did search for this but couldn’t find a thread that was quite what i wanted.
You would have to use derma to make the spawn list, then to get the derma to pop up on Q you would have to add the commands:
concommand.Add( “+menu”, <function name here> ) – this will open the menu when we hit q.
concommand.Add( “-menu”, function() <derma name here>:Close() end ) – this will close the menu when we let go of q.
When you say function name, you mean say, function Spawnmenu, then the derma inside it? And the derma name is just something like: Name = vgui.Create( “DFrame” ), so the derma name is Name. I hope that made sense. Then i take it that, that code goes in init.lua and the function goes inside cl_init.lua , i know it’s pretty nooby but this is newby questions right
I put that code in my gamemode and I get: Unknown Command: ‘+menu’ and Unknown Command: ‘-menu’ which i don’t understand because isn’t that what concommand.Add( “+menu”, does?. Help please
its giving you an error because you are creating a clientside command on the server.
All the code goes into cl_init.lua because it is meant to be executed by the CLIENT and not the SERVER.
Once you put the entire code that has to relate to the menu into the client, try testing it again and letting us know what the result is.