Globals
Global functions defined in NutScript.
Some functions exist in the global realm (_G) instead of being part of a class or module.
Networking global functions
setNetVar (key, value, receiver)
setNetVar
Sets a global network variable. Broadcasts the variable to specified receivers.
Parameters:
string key Name of the variablevararg value Value to assign
Client
receiver
optional
Client or list of clients to receive the update
getNetVar (key, default)
getNetVar
Gets a global network variable. Returns default value if key does not exist. The clientside version of the function can only return data that was previously networked to the client.
Parameters:
string key Variable namevararg
default
optional
Default fallback value
Returns:
The global value or the defaultLanguage functions
L (key, client, ...)
L
Gets localized string with formatting (server version)
Parameters:
string key Language string keyClient client Target player for language preference
vararg ... Format arguments
Returns:
string Formatted localized stringOr
string Original key if translation missingUsage:
L2 (key, client, ...)
L2
Gets localized string only if exists (server version)
Parameters:
string key Language string keyClient client Target player for language preference
vararg ... Format arguments
Returns:
string Formatted string if translation existsOr
nil If no translation foundL3 (key, langKey, ...)
L3
Gets localized string with explicit language (server version)
Parameters:
string key Language string keystring langKey Specific language to use
vararg ... Format arguments
Returns:
string Formatted localized stringOr
string Original key if translation missingL (key, ...)
L
Gets localized string with formatting (client version)
Parameters:
string key Language string keyvararg ... Format arguments