If I did a "local Player = FindMetaTable("Player")" server side, in for example "sv_player.lua," will there be only one? What I mean is, if I were to create variables like "Player.Info = 123" would that be the same for every player, or would that variable be able to be set for each individual player?
I'd have to actually test it to be sure what would happen in the situation you describe but let me explain a bit about meta tables so you can figure it out yourself.
Meta tables are sorta like fallback tables. Lua will check the object's table first to see if it has the value for a given key. If it doesn't find the value then it checks for it in the table's metatable if it has one. Entities are sorta like tables and every entity has an assigned meta table which you can get using FindMetaTable. If you set a value in the entity metatable then it will be possible to index that value for every entity. Now this is just speculative but if you change a value on an entity it should create a new index in that entity's table with that value which aught to override the metatable's value but only for that particular entity.
Sorry, you need to Log In to post a reply to this thread.