Thanks to visit codestin.com
Credit goes to github.com

Skip to content

API: Syncer

ᴏᴠ ━ ᴀɴɪꜱᴀ edited this page Mar 4, 2025 · 1 revision

» Overview

Assetify provides integrated Global and Element Data synchronization features that are ready for immediate use. These functionalities operate on a table buffer and are compatible across various resources. Furthermore, we believe that MTA's setElementData and getElementData APIs fall short of expectations.

» Importing

Add the below code globally once in either of the shared .lua script of the resource you want to use within:

loadstring(exports.assetify_library:import("syncer"))()

» APIs

  • assetify.syncer.setGlobalData() - shared

    Sets a global data's value.
    🚨 You can track any data changes via Assetify:onGlobalDataChange as per your requirements!

    local bool: result = assetify.syncer.setGlobalData(
       string: data,
       ~: value,
       bool: isSync
    )
  • assetify.syncer.getGlobalData() - shared

    Retrieves specified global data's value.

    local bool: result = assetify.syncer.getGlobalData(
       string: data
    )
  • assetify.syncer.getAllGlobalDatas() - shared

    Retrieves all stored global datas.

    local table: result = assetify.syncer.getAllGlobalDatas()
  • assetify.syncer.setEntityData() - shared

    Sets a element's data's value.
    🚨 Client side setters aren't synced for security reasons.
    🚨 You can track any data changes via Assetify:onEntityDataChange as per your requirements!

    local bool: result = assetify.syncer.setEntityData(
       element: element,
       string: data,
       ~: value,
       bool: isSync
    )
  • assetify.syncer.getEntityData() - shared

    Retrieves specified element's data's value.

    local bool: result = assetify.syncer.getEntityData(
       element: element,
       string: data
    )
  • assetify.syncer.getAllEntityDatas() - shared

    Retrieves specified element's all stored entity datas.

    local table: result = assetify.syncer.getAllEntityDatas(
       element: element
    )
Clone this wiki locally