Skip to main content

Cache

This item only works when running on the client. ClientRequiresSchema

A warmed sound is built once and kept in SoundService.WarmedSounds until you chill it. While it is warmed, Fetch clones it instead of building it. Use this for sounds that matter during one part of the game, and chill them when that part is over.

Warming does not download the sound's asset. The engine loads an asset the first time a Sound with that id plays, or when Preload is used.

Functions​

Get​

Cache.Get() → {[string]: Sound}--

Every warmed template, keyed by name. Do not modify it.

print(VluxySF.Cache.Get())

IsWarmed​

Cache.IsWarmed(
soundName: string--

The sound name.

) → boolean--

Whether the sound is warmed.

print(VluxySF.Cache.IsWarmed("MySound"))

Warm​

Cache.Warm(
...: string--

The sound names.

) → ()

Warms sounds by name. A name that is already warmed is skipped. A name that is not in the schema prints a warning.

VluxySF.Cache.Warm("BossRoar", "BossStomp")

Chill​

Cache.Chill(
...: string--

The sound names.

) → ()

Chills sounds by name: their templates are destroyed. Sounds you already fetched are not affected. A name that is not warmed is ignored.

VluxySF.Cache.Chill("BossRoar", "BossStomp")
Show raw api
{
    "functions": [
        {
            "name": "Get",
            "desc": "```lua\nprint(VluxySF.Cache.Get())\n```",
            "params": [],
            "returns": [
                {
                    "desc": "Every warmed template, keyed by name. Do not modify it.",
                    "lua_type": "{ [string]: Sound }"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 34,
                "path": "lib/Api/Cache.luau"
            }
        },
        {
            "name": "IsWarmed",
            "desc": "```lua\nprint(VluxySF.Cache.IsWarmed(\"MySound\"))\n```",
            "params": [
                {
                    "name": "soundName",
                    "desc": "The sound name.",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "Whether the sound is warmed.",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 52,
                "path": "lib/Api/Cache.luau"
            }
        },
        {
            "name": "Warm",
            "desc": "Warms sounds by name. A name that is already warmed is skipped. A name that is not in the schema prints a warning.\n\n```lua\nVluxySF.Cache.Warm(\"BossRoar\", \"BossStomp\")\n```",
            "params": [
                {
                    "name": "...",
                    "desc": "The sound names.",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 70,
                "path": "lib/Api/Cache.luau"
            }
        },
        {
            "name": "Chill",
            "desc": "Chills sounds by name: their templates are destroyed. Sounds you already fetched are not affected. A name that\nis not warmed is ignored.\n\n```lua\nVluxySF.Cache.Chill(\"BossRoar\", \"BossStomp\")\n```",
            "params": [
                {
                    "name": "...",
                    "desc": "The sound names.",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 104,
                "path": "lib/Api/Cache.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Cache",
    "desc": "A warmed sound is built once and kept in `SoundService.WarmedSounds` until you chill it. While it is warmed,\n`Fetch` clones it instead of building it. Use this for sounds that matter during one part of the game, and chill\nthem when that part is over.\n\nWarming does not download the sound's asset. The engine loads an asset the first time a `Sound` with that id\nplays, or when `Preload` is used.",
    "tags": [
        "RequiresSchema"
    ],
    "realm": [
        "Client"
    ],
    "source": {
        "line": 23,
        "path": "lib/Api/Cache.luau"
    }
}