From Garry's Mod
Jump to: navigation, search



In order to maintain consitency on the wiki, we require you to follow next rules:

  • All function/content links must use templates:
    • For class methods:
    • For library functions:
      • Code: {{LibraryFunction|ents|Create}}
      • Preview: ents.Create

    • For global functions:
      • Code: {{GlobalFunction|AddCSLuaFile}}
      • Preview: AddCSLuaFile

    • For hooks:
    • For enumerations:
    • For structures:
    • For types, classes and panels:
    • For libraries:
    • For shaders:
  • It's Lua, not LUA, LUa, lua or LuA.
  • It's SENT, not SEnt.
  • It's SWEP, not SWep.
  • It's TOOL, not STOOL.

  • If output of an example is not available, don't put N/A, just leave the field empty.
  • If you don't know an argument name or description, don't put UNKNOWN, just leave it blank.
  • Put proper descriptions for arguments and return values, not just their names with one word.
  • Argument names must start with a lower case letter.
    • Position is bad, pos is good.
  • Do not put type indentifier as first letter.
    • iNum is bad, num is good.

  • Try to match coding style of your examples with coding style of other examples on other pages.
    • Do not put any semicolons.
    • Keep underscores to minimum.
    • Use Entity( 1 ) for player.
    • Use Vector( 0, 0, 0 ) and Angle( 0, 0, 0 ) for arguments, not just something like vPos.
    • Use Player1 in place of a player's nickname in example output. Additional players can be Player2, Player3, and so on.
    • Avoid useless globals.
    • Use --, not //.
    • Try to make the example be ready for use by other people, so that they can throw it into their Lua file or use lua_run and it works.
    • Try to space out function arguments, put a space after each coma, bracket like so:
function ENT:Think()
	self:MyFunction( "test argument", 1, false )


To edit a function definition - please click on the edit with form link on the top left.

Special Pages


Editing hooks works the same as editing functions.

Special Pages

Useful pages

  • Special:Upload - Use this to upload images to the Wiki for examples and tutorials
  • Property:LuaType - The list of acceptable Lua Types for forms (feel free to expand)
  • Special:WhatLinksHere - A useful page that shows all pages that are linking to the inputted one.

Ways to contribute


You can upload an image in Special:Upload, and embed it using the "File:" tag.


Tutorials where possible should be short and sweet. They should focus only on the subject they're covering - and not try to cover too much.


Tutorials should not contain slashes in their names. They should be titled as the subject they're covering, with appropriate capitals and spaces.

Try to give your page a name starting with the letter that a user might be searching for. For example, if your page is about developing for the Kinect - call it "Kinect Development" - not "Developing For Kinect". This way when the page is in an alphabetical list it's listed under K and not D.


You can see a list of categories here. You should add your page to all appropriate categories by ticking the category boxes on the edit page.

Personal tools