-
Notifications
You must be signed in to change notification settings - Fork 0
NWVars
googer_ edited this page Nov 13, 2024
·
1 revision
NWVars are very usable in Garry's mod for when you want to share some variable with clients from server and don't bother adding networking it yourself. However, you need to know the type of variable you want to read or write and each of them are limited with shared 4096 amount limit as each creates new NetworkString. GNWVars instead use GNet which doesn't have normal net limits.
- ID:
ext_nwvar

Entity.SetGNWVar(self: Entity, key: any, var: any)
Sets entity's NetWork Variable

Entity.GetGNWVar(self: Entity, key: any) -> var: any
Gets entity's NetWork Variable

Entity.SetGNWVarCallback(self: Entity, key: any, callback: function)
Sets a function to be called when the NW var changes
Callback arguments: function(ent: Entity, key: any, old: any, new: any)