Meta tables

Anyone know a good link to create custom lets say Player functions?

Like say I want to override a existing one and create a few new ones.
How would this go in work? Any wiki explanation or examples?

The one i’m wanting to override is Player:IsAdmin()
Can anyone push me in the right direction please.

**[G.FindMetaTable

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=G.FindMetaTable)**

Thanks that will help me for the beginning

For anyone still wondering, you can overwrite metafunctions by overwriting them in the _R table. You can index a function like
[lua]
_R[“type”].nameOfFunction
[/lua]
where “type” is the string name of the type of object for which you want to overwrite the metafunction, and nameOfFunction obvious.

If you wanted to overwrite Player.IsAdmin, you could do:
[lua]
_R[“Player”].IsAdmin = function(self) return false end
[/lua]
to make it always return false.

If you add this in init before including other files, you can use the function everywhere in your lua files?

Yes

[editline]05:21PM[/editline]

But only the ones that are run in the same state (client/server)