Skip to content

Attributes

Attribute helpers for loading, registering, and setting up character attributes.


Overview

The attributes library centralizes shared attribute behavior under `lia.attribs`. It stores registered attribute definitions, loads attribute files from a directory, registers attribute metadata, resolves localized names and descriptions, and runs server-side setup callbacks for character attributes.

lia.attribs.loadFromDir(directory)View Source

Purpose

Loads and registers all attribute definition files from a directory.

Realm

Shared

Parameters

string directory The Lua directory containing attribute definition files.

Returns

Example Usage

  lia.attribs.loadFromDir("schema/attributes")

lia.attribs.register(uniqueID, data)View Source

Purpose

Registers an attribute definition and stores it in the attribute list.

Realm

Shared

Parameters

string uniqueID The unique identifier used to store and reference the attribute.

table data The attribute data to merge into the registered attribute definition.

Returns

table The registered attribute table.

Example Usage

  lia.attribs.register("strength", {
      name = "strength",
      desc = "strengthDesc"
  })

lia.attribs.setup(client)View Source

Purpose

Runs setup behavior for each registered attribute on a player's active character.

Realm

Server

Parameters

Player client The player whose character attributes are being initialized.

Returns

Example Usage

  lia.attribs.setup(client)