Garry's Mod Wiki

Specific Operators

Garry's Mod features a set of non-default operators and aliases of already existing ones.

The implemented operators include

Operator
continue
continue may work incorrectly, consider using goto

Example

Use goto for the same functionality as continue, this example loops through all the players and kills all superadmins then respawns them.

for k, v in pairs( player.GetAll() ) do if not v:IsSuperAdmin() then goto continue -- skips any iterations where the player is not superadmin end v:Kill() v:Spawn() ::continue:: end

The implemented aliases are as following

Operator Alias
and &&
or ||
not !
~= !=
--[[ ]] /* */
-- //
It is suggested to avoid using the custom operators if you wish to use your scripts outside of Garry's Mod, as they are incompatible with standard Lua.

Page Links


Special Pages


Wikis

?

Render Time: 61ms

DB GetPage 35
Generate Html 0
SaveChanges (1) 13
Render Body 0
Render Sidebar 10