Skip to content

API: Sound

ᴏᴠ ━ ᴀɴɪꜱᴀ edited this page Mar 4, 2025 · 5 revisions

» Overview

Assetify offers a comprehensive suite of sound APIs designed for seamless integration into your external resources. This module allows developers to effortlessly incorporate sound assets directly into their resources, eliminating the need for extensive customization or additional overhead.

» 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("sound"))()

» APIs

  • assetify.sound.play - client

    Plays a valid sound asset.

    local sound: cSound = assetify.sound.play(
       string: assetName,
       string: soundCategory,
       int: soundIndex,
       float: soundVolume,
       bool: isScoped,
       bool: isLooped
    )
  • assetify.sound.play3D - client

    Plays a valid sound asset in 3D.

    local sound: cSound = assetify.sound.play3D(
       string: assetName,
       string: soundCategory,
       int: soundIndex,
       float: soundVolume,
       bool: isScoped,
       float: posX,
       float: posY,
       float: posZ,
       bool: isLooped
    )