Skip to main content

PlayerDataStoreService

This item only works when running on the server. Server

Centralized service using serviceBag. This will let other packages work with a single player datastore service.

Functions

Init

PlayerDataStoreService:Init(serviceBagServiceBag) → ()

Initializes the PlayerDataStoreService. Should be done via ServiceBag.Init.

Start

PlayerDataStoreService:Start() → ()

Initializes the datastore service for players. Should be done via ServiceBag.Start.

SetDataStoreName

PlayerDataStoreService:SetDataStoreName(dataStoreNamestring) → ()

Sets the name for the datastore to retrieve.

info

Must be done before start and after init.

SetDataStoreScope

PlayerDataStoreService:SetDataStoreScope(dataStoreScopestring) → ()

Sets the scope for the datastore to retrieve.

info

Must be done before start and after init.

PromiseDataStore

PlayerDataStoreService:PromiseDataStore(playerPlayer) → Promise<DataStore>

Gets the datastore for the player.

PromiseAddRemovingCallback

PlayerDataStoreService:PromiseAddRemovingCallback(
callbackfunction--

May return a promise

) → Promise

Adds a removing callback to the manager.

PromiseManager

PlayerDataStoreService:PromiseManager() → PlayerDataStoreManager

Retrieves the manager

Show raw api
{
    "functions": [
        {
            "name": "Init",
            "desc": "Initializes the PlayerDataStoreService. Should be done via [ServiceBag.Init].",
            "params": [
                {
                    "name": "serviceBag",
                    "desc": "",
                    "lua_type": "ServiceBag"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 22,
                "path": "src/datastore/src/Server/PlayerDataStoreService.lua"
            }
        },
        {
            "name": "Start",
            "desc": "Initializes the datastore service for players. Should be done via [ServiceBag.Start].",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 38,
                "path": "src/datastore/src/Server/PlayerDataStoreService.lua"
            }
        },
        {
            "name": "SetDataStoreName",
            "desc": "Sets the name for the datastore to retrieve.\n\n:::info\nMust be done before start and after init.\n:::",
            "params": [
                {
                    "name": "dataStoreName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 52,
                "path": "src/datastore/src/Server/PlayerDataStoreService.lua"
            }
        },
        {
            "name": "SetDataStoreScope",
            "desc": "Sets the scope for the datastore to retrieve.\n\n:::info\nMust be done before start and after init.\n:::",
            "params": [
                {
                    "name": "dataStoreScope",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 69,
                "path": "src/datastore/src/Server/PlayerDataStoreService.lua"
            }
        },
        {
            "name": "PromiseDataStore",
            "desc": "Gets the datastore for the player.",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<DataStore>"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 82,
                "path": "src/datastore/src/Server/PlayerDataStoreService.lua"
            }
        },
        {
            "name": "PromiseAddRemovingCallback",
            "desc": "Adds a removing callback to the manager.",
            "params": [
                {
                    "name": "callback",
                    "desc": "May return a promise",
                    "lua_type": "function"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 94,
                "path": "src/datastore/src/Server/PlayerDataStoreService.lua"
            }
        },
        {
            "name": "PromiseManager",
            "desc": "Retrieves the manager",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "PlayerDataStoreManager"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 105,
                "path": "src/datastore/src/Server/PlayerDataStoreService.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PlayerDataStoreService",
    "desc": "Centralized service using serviceBag. This will let other packages work with a single player datastore service.",
    "realm": [
        "Server"
    ],
    "source": {
        "line": 7,
        "path": "src/datastore/src/Server/PlayerDataStoreService.lua"
    }
}