Skip to main content

Preload

This item only works when running on the client. ClientRequiresSchema

Preloaded sounds are built once, kept in SoundService.PreloadedSounds for the whole session, and loaded by ContentProvider. Fetch clones them instead of building them, so they play without a delay.

Sounds tagged VluxySF_Preload in Studio are preloaded by Startup.InitClient. Use Selected to preload more at runtime.

Functions​

Get​

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

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

print(VluxySF.Preload.Get())

Selected​

This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. Yields
Preload.Selected(
...: string--

The sound names.

) → ()

Preloads more sounds by name. Yields until they are loaded. A name that is already preloaded prints a warning.

VluxySF.Preload.Selected("Footstep", "Jump")
Show raw api
{
    "functions": [
        {
            "name": "Get",
            "desc": "```lua\nprint(VluxySF.Preload.Get())\n```",
            "params": [],
            "returns": [
                {
                    "desc": "Every preloaded template, keyed by name. Do not modify it.",
                    "lua_type": "{ [string]: Sound }"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 32,
                "path": "lib/Api/Preload.luau"
            }
        },
        {
            "name": "Selected",
            "desc": "Preloads more sounds by name. Yields until they are loaded. A name that is already preloaded prints a warning.\n\n```lua\nVluxySF.Preload.Selected(\"Footstep\", \"Jump\")\n```",
            "params": [
                {
                    "name": "...",
                    "desc": "The sound names.",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "static",
            "yields": true,
            "source": {
                "line": 52,
                "path": "lib/Api/Preload.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Preload",
    "desc": "Preloaded sounds are built once, kept in `SoundService.PreloadedSounds` for the whole session, and loaded by\n`ContentProvider`. `Fetch` clones them instead of building them, so they play without a delay.\n\nSounds tagged `VluxySF_Preload` in Studio are preloaded by `Startup.InitClient`. Use `Selected` to preload more at\nruntime.",
    "tags": [
        "RequiresSchema"
    ],
    "realm": [
        "Client"
    ],
    "source": {
        "line": 21,
        "path": "lib/Api/Preload.luau"
    }
}