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.


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
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:
_R[“Player”].IsAdmin = function(self) return false end
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?



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