Summary

Functions

Returns whether two values are equal, comparing tables by content.
Returns the value of a global networked variable.
Sets a global networked variable and sends it to clients.

Functions

Returns whether two values are equal, comparing tables by content.

Parameters

  • old Any The first value
  • new Any The second value

Returns

  • Boolean Whether the values are equal
  • String 'table' when both values are tables

netvars.GetNetVar(key, default)

shared gamemodes/catwork/gamemode/core/libraries/sv_netvars.lua:198

On the server

Returns the value of a global networked variable.

Parameters

  • key String Name of the variable
  • default Any optional, defaults to nil Value to return if the variable is nil or false

Returns

  • Any The value, or default

See also

On the client

Returns the value of a global networked variable received from the server.

Parameters

  • key String Name of the variable
  • default Any optional, defaults to nil Value to return if the variable is nil or false

Returns

  • Any The value, or default

Defined in

netvars.SetNetVar(key, value, receiver)

server gamemodes/catwork/gamemode/core/libraries/sv_netvars.lua:67

Sets a global networked variable and sends it to clients.

Does nothing if a non-table value is unchanged, or if the value contains a function (which prints an error). Players who join later receive it through Player:SyncVars.

Parameters

  • key String Name of the variable
  • value Any The new value; must not be or contain a function
  • receiver Player optional, defaults to nil A player or list of players to send the change to; nil sends it to everyone

See also

Defined in