Metatables?

Well, What are these, How are they useful? Got any good documentaion. Alot of people tell me to learn these and that they will be useful, But cannot find a good place to start with hem, Thanks!

They let you modify how tables work and are accessed.

They’re useful for creating class-like systems and adding support for mathematic operators on the table, among other unique things.

just to note, there is an issue with them randomly corrupting that hasn’t been fixed yet which causes your entire server to fuck up/crash

I don’t think you understand this, metatables hold all the functions that can be ran an on object including all the functions included with gmod, as far as we know adding metatable entries doesn’t affect it, and correct me if I’m wrong, but isn’t the corruption bug Dev branch only?

Corruption has been live for a few updates now.

I’d suggest pretending that the “Metamethods” wiki tutorial doesn’t exist.

Here’s one that describes the functions: https://dl.dropboxusercontent.com/u/26074909/tutoring/classes/class_tutorial.lua.html

And here is an example ( cards ): https://dl.dropboxusercontent.com/u/26074909/tutoring/classes/class_card.lua.html

Meta-tables are objects that can be cloned. They’re quite useful in certain situations. The card example lets you either create cards / copies or pass in the value ( modded % so more than 1 deck can be used ) to achieve the same result without the overhead.

No.