Skip to content

Attributes

Attributes that define various RPG stats of a character. Attributes allow characters to be more defined within an RPG context.

Functions

nut.attribs.loadFromDir (directory)
nut.attribs.loadFromDir

Internal

This is used internally - although you're able to use it you probably shouldn't.

Plugin function

This is defined and used within the Attributes plugin. As such, its functionality might differ in different schemas, or be unavailable.

Load attribute files from a directory.

Parameters:

string directory Path of the directory containing attribute files

nut.attribs.setup (client)
nut.attribs.setup

Internal

This is used internally - although you're able to use it you probably shouldn't.

Plugin function

This is defined and used within the Attributes plugin. As such, its functionality might differ in different schemas, or be unavailable.

Run onSetup functions of each relevant attribute on a client.

Parameters:

Client client Target player entity

Character methods

charMeta:updateAttrib (key, value)
charMeta:updateAttrib
Plugin function

This is defined and used within the Attributes plugin. As such, its functionality might differ in different schemas, or be unavailable.

adds a value to a character's attribute. The new value cannot exceed the attributes maxValue or the maxAttribs config

Parameters:

string key the id of attribute

number value the value to be added

charMeta:setAttrib (key, value)
charMeta:setAttrib
Plugin function

This is defined and used within the Attributes plugin. As such, its functionality might differ in different schemas, or be unavailable.

sets a character's attribute value.

Parameters:

string key the id of attribute

number value the value to be added

charMeta:addBoost (boostID, attribID, boostAmount)
charMeta:addBoost
Plugin function

This is defined and used within the Attributes plugin. As such, its functionality might differ in different schemas, or be unavailable.

adds a boost to a character's attribute. The boost acts as a (semi-)temporary change to the attribute value without changing the base value.

Parameters:

string boostID ID of the boost. Used to easily edit/remove the boost later

string attribID the id of attribute

number boostAmount the value to be added

charMeta:removeBoost (boostID, attribID)
charMeta:removeBoost
Plugin function

This is defined and used within the Attributes plugin. As such, its functionality might differ in different schemas, or be unavailable.

removes a boost from a character's attribute.

Parameters:

string boostID ID of the boost

string attribID the id of attribute

charMeta:getBoost (attribID)
charMeta:getBoost
Plugin function

This is defined and used within the Attributes plugin. As such, its functionality might differ in different schemas, or be unavailable.

Get all applied boosts to a character's attribute.

Parameters:

string attribID ID of the attribute

Returns:

table A list of boosts applied to the character's attribute

charMeta:getBoosts ()
charMeta:getBoosts
Plugin function

This is defined and used within the Attributes plugin. As such, its functionality might differ in different schemas, or be unavailable.

Get all boosts applied to a character, across all attributes.

Returns:

table A list of all boosts applied to a character

charMeta:getAttrib (key, default)
charMeta:getAttrib
Plugin function

This is defined and used within the Attributes plugin. As such, its functionality might differ in different schemas, or be unavailable.

Get a character's current attribute value. Includes applied boosts.

Parameters:

string key the ID of the attribute

number default the default value if the character does not have an attribute value