This forum is for help with modding Garry’s Mod.
This does NOT include Mapping or Modelling.
Your first call should be the official Garry’s Mod Wiki.
If you don’t find what you need - please post a thread in this forum asking for the information to be put on the wiki - that way you can help everyone.
If you are posting a Lua error you’re getting - then POST THE FULL ERROR AND THE CODE. Make sure you are posting the FIRST error you’re getting - not the last error. Make thread titles descriptive. Naming your thread “Lua Help” and nothing else will probably get you banned.
Do not post huge scripts and expect people to fix them. If you wrote the script then you should know why it doesn’t work. If you’re editing someone’s script and can’t get it to work then don’t! Learn how to code!
KEEP DARKRP QUESTIONS TO THIS THREAD: http://forum.facepunch.com/showthread.php?t=1249475
KEEP SMALL QUESTIONS TO THIS THREAD: http://forum.facepunch.com/showthread.php?t=1548067
OFFICIAL GARRY’S MOD WIKI DISCUSSION: http://forum.facepunch.com/showthread.php?t=1250533
GMAD.EXE THREAD: http://forum.facepunch.com/showthread.php?t=1242185
GMPUBLISH.EXE THREAD: http://forum.facepunch.com/showthread.php?t=1244179
Want to learn Lua & GLua?
Assuming you have no knowledge of any kind of programming language, Lua is a good place to start because it is a high-level scripting language. That means it is easier to understand. Other good programming languages to start with include Java and C# ( easier than C++ ).
Before you start with any programming language, you will need a text editor, preferably with Syntax Highlighting. Here are some recommended ones:
- Notepad++ ( + GLua highlighter plugin ) - Fast and lightweight Windows only text editor
- Sublime Text 3 ( + Falco’s highlighting for GLua ) - Lightweight Cross-platform text editor with many features
Atom - Free Chromium powered text editor with many features
Note! **MS **Word or Wordpad will NOT work. Notepad will work, however, it’s recommended to either use Notepad++ or Sublime, for syntax highlighting and extra convenience features…
GLua is a modified version of Lua 5.1, so you may find it beneficial to learn vanilla Lua first. Here are some great resources for that:
- Official Reference Manual (5.1) - This is the version Garry’s Mod utilizes
- Official Reference Manual (5.3) - Latest version of Lua
- Programming in Lua Book
- Lua Users Tutorial
- Sample Lua Book
- Learn X in Y
If you already know Lua, or you would rather go straight into GLua (it’s highly recommended you start with some basic Lua first), here are many useful resources:
- Official Garry’s Mod Wiki
- Old Garry’s Mod Wiki - Very outdated to current version of GMod but still has some great tutorials.
- GLua Docs - Alternate website that provides the same information that the official wiki does
If you are converting old code from past versions of GMod, these are very useful:
If you are more hands-on person that likes seeing examples, here are some YouTubers that do great tutorials:
If you want to try Lua in other environments besides Garry’s Mod - World of Warcraft, Roblox and Love2D (2D Game Engine) all utilize Lua in very modular ways. Here’s a full list of games that utilize Lua.