Skip to main content

Store

Handles Mad Studio ProfileStore integration for skill tree player state persistence.

Functions

new

Store.new(
storeNamestring,--

DataStore name for ProfileStore

defaultStatePlayerSkillState--

Default state for new players (serializable fields only)

) → Store

Creates a new Store instance.

load

Store:load(
playerIdstring--

The UserId as a string

) → PlayerSkillState?--

The player's state, or nil if load failed

Loads a player's skill tree state from ProfileStore.

save

Store:save(
playerIdstring,--

The UserId as a string

statePlayerSkillState--

The state to save

) → boolean--

True if save succeeded

Saves a player's skill tree state to ProfileStore.

clear

Store:clear(
playerIdstring--

The UserId as a string

) → boolean--

True if clear succeeded

Clears all data for a player and resets to default state.

release

Store:release(
playerIdstring--

The UserId as a string

) → ()

Ends the profile session after the server is done with this player's data (e.g. player left).

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Creates a new Store instance.",
            "params": [
                {
                    "name": "storeName",
                    "desc": "DataStore name for ProfileStore",
                    "lua_type": "string"
                },
                {
                    "name": "defaultState",
                    "desc": "Default state for new players (serializable fields only)",
                    "lua_type": "PlayerSkillState"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Store"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 28,
                "path": "src/Store.luau"
            }
        },
        {
            "name": "load",
            "desc": "Loads a player's skill tree state from ProfileStore.",
            "params": [
                {
                    "name": "playerId",
                    "desc": "The UserId as a string",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "The player's state, or nil if load failed",
                    "lua_type": "PlayerSkillState?"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 44,
                "path": "src/Store.luau"
            }
        },
        {
            "name": "save",
            "desc": "Saves a player's skill tree state to ProfileStore.",
            "params": [
                {
                    "name": "playerId",
                    "desc": "The UserId as a string",
                    "lua_type": "string"
                },
                {
                    "name": "state",
                    "desc": "The state to save",
                    "lua_type": "PlayerSkillState"
                }
            ],
            "returns": [
                {
                    "desc": "True if save succeeded",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 71,
                "path": "src/Store.luau"
            }
        },
        {
            "name": "clear",
            "desc": "Clears all data for a player and resets to default state.",
            "params": [
                {
                    "name": "playerId",
                    "desc": "The UserId as a string",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "True if clear succeeded",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 87,
                "path": "src/Store.luau"
            }
        },
        {
            "name": "release",
            "desc": "Ends the profile session after the server is done with this player's data (e.g. player left).",
            "params": [
                {
                    "name": "playerId",
                    "desc": "The UserId as a string",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 103,
                "path": "src/Store.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "Store",
    "desc": "Handles Mad Studio ProfileStore integration for skill tree player state persistence.",
    "source": {
        "line": 11,
        "path": "src/Store.luau"
    }
}