Garry’s Mod (GMod) is a popular sandbox game that allows players to manipulate objects and experiment with physics. One powerful feature in GMod is the developer console, which gives access to cheat commands, server commands, debugging info, and more. However, the console is disabled by default. Here is a step-by-step guide on how to open and access the developer console in Garry’s Mod:
Table of Contents
Enabling the Developer Console
To enable the developer console:
- Launch Garry’s Mod
- In the main menu, click on Options
- Select the Keyboard tab
- Click on Advanced at the bottom
- Check the box next to Enable Developer Console (~)
- Click OK and then Apply to save the changes
Opening the Developer Console
Once enabled, you can open the developer console in-game by pressing the ` key, which is the key below Esc and left to the 1 key on standard keyboards.
On laptops, you may need to press Fn + ` to open the console.
Changing the Console Toggle Keybind
If pressing the ` key does not open the console, you likely have a non-English keyboard layout. In that case, you’ll need to change the console toggle keybind:
- Right-click Garry’s Mod in your Steam library
- Click Properties
- Under General, click Set Launch Options
- Type
-console
(this enables console on launch) - Type
+bind
followed by your new key for toggling console
- For example:
+bind k toggleconsole
- Launch Garry’s Mod
You can now toggle the console by pressing your chosen key.
Using Console Commands
Once the console is open, you can type GMod commands and press Enter to run them. Useful commands include:
sv_cheats 1
– Enables cheat commandsnoclip
– Player can fly and clip through wallsimpulse 101
– Gives all weaponsbuddha
– Player takes damage but health never goes below 1god
– Player becomes invinciblethirdperson
– Toggles third person cameragm_showhelp
– Lists all console commands
Basic Scripting in the Console
The GMod console can also be used to run simple Lua scripts:
print("Hello World!") -- Prints a message
local ent = ents.Create("prop_physics") -- Spawns a physics prop
ent:SetModel("models/props_junk/PopCan01a.mdl") -- Sets prop model
ent:SetPos(Vector(0, 0, 72)) -- Sets position
ent:Spawn() -- Spawns the prop
This allows you to test out concepts before making an actual addon.
Important Notes
- Console commands only work in singleplayer or on servers with
sv_cheats 1
- Scripts can crash your game if they contain errors
- The console does not open while in multiplayer menus
- Bind console to a different key if ` does not work
- Console output can help diagnose mod issues
Accessing the Console on Servers
If you run a GMod server, the console allows server administration from in-game or via RCON tools. Useful commands include:
ulx adduser
ulx removeuser
ulx ban
ulx slap
ulx teleport
sv_password
See the ULib wiki for details on managing users and permissions.
So in summary, enabling and accessing the developer console unlocks many useful features in GMod. It takes just a few steps to set up, and allows cheating, scripting, debugging, and server management. Give it a try and see what interesting things you can do!