Skip to content

Data

This page documents hooks in the data category.


OnDataSet(key, value, gamemode, map)View Source

Purpose

Runs after `lia.data.set` updates the cached value and writes the scoped data file.

Category

Data

Realm

Server

Parameters

string key The data key that was stored.

any value The value that was stored.

string gamemode The resolved gamemode scope used for the write.

string map The resolved map scope used for the write.

Example Usage

  hook.Add("OnDataSet", "liaExampleOnDataSet", function(key, value, gamemode, map)
      print("[MyModule] handled OnDataSet")
  end)

PersistenceSave()View Source

Purpose

Runs on the periodic data-save timer so modules and plugins can save persistent entities.

Category

Data

Realm

Server

Example Usage

  hook.Add("PersistenceSave", "liaExamplePersistenceSave", function()
      print("[MyModule] handled PersistenceSave")
  end)

SaveData()View Source

Purpose

Runs on the periodic data-save timer so modules and plugins can save their own data.

Category

Data

Realm

Server

Example Usage

  hook.Add("SaveData", "liaExampleSaveData", function()
      print("[MyModule] handled SaveData")
  end)