Skip to content
googer_ edited this page Nov 13, 2024 · 1 revision

About Ext_NWVars

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.

Capability ext_nwvar

Info

  • ID: alt text ext_nwvar

Functions

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

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

alt text 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)

Clone this wiki locally