Operator

From GMod Wiki

Jump to: navigation, search

Operators are symbols that run functions. Operators can take one or two arguments:

 
--Takes one argument
!5
 
--Takes two arguments
21+5
 

So doing 21+5 is equivelent to doing __add(21,5) and getting 26 back. Operators exist to make your scripting go faster.

Operators can be overloaded to change what they normally do.

Overloaded operators are stored in metatables, and can be identified easily because they have two underscores (_).

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox