Default F4 Menu Error

Firstly sorry if this is in the wrong section.

My problem is i tried to change the f4 menu using DarkRPmodification addon and when i found i didnt like any of them i tried to change back to the original one but i then get an error saying this.

[ERROR] addons/darkrpmodification/lua/darkrp_modules/f4menu/cl_init.lua:30: attempt to index global ‘GM’ (a nil value)

  1. unknown - addons/darkrpmodification/lua/darkrp_modules/f4menu/cl_init.lua:30
  2. doInclude - [C]:-1
  3. loadModules - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:86
  4. fn - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:126
  5. unknown - addons/ulib/lua/ulib/shared/hook.lua:183

and that line of code looks like this:

GM.ShowSpare2 = DarkRP.toggleF4Menu

anyone know whats wrong and can help?
Thanks in advance.

Try replacing GM with GAMEMODE

Addons load prior to game-mode initialization meaning GM and GAMEMODE will NOT be valid.

You could use a hook.Add though and return non-nil to overwrite the default behavior. Then, you can create your own panel…

https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/open_vgui_based_on_keypress.lua.html