Garry's Mod Wiki
Data Table Variables
These variables are the preferred method as they use the built in network variable system, so they get networked, saved and predicted properly. You should use this method by default.
To add a new variable simply add a SetupDataTables() function to it. For example.
Network variables should be defined both on server and client.
You have now defined three variables on your entity. You can access these variables like this:
And set them like:
You can of course set and get from outside of the entity:
The String type has a length limit of 512 chars.
If there are Strings that are repeatedly used in your entity, it is a good idea to store those Strings in a table and network the table index of the String, rather than networking the entire String each time.
If there are Strings that are repeatedly used in your entity, it is a good idea to store those Strings in a table and network the table index of the String, rather than networking the entire String each time.
This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.
Page content is automatically updated twice a day. Edits and history are not available.
Last Parsed: Loading...