Skip to main content

GameDataStoreService

This item only works when running on the server. Server

Service which manages central access to datastore. This datastore will refresh pretty frequently and can be used for configuration and other components, such as Twitter codes or global settings.

Functions

SetRobloxDataStore

GameDataStoreService.SetRobloxDataStore(
robloxDataStoreDataStore | DataStoreMock
) → ()

Injects the underlying datastore to use instead of resolving a real one. Accepts a real datastore or a DataStoreMock. Intended for testing; must be called before the datastore is first resolved.

PromiseDataStore

GameDataStoreService.PromiseDataStore(selfGameDataStoreService) → Promise<DataStore>

Promises a DataStore for the current game that is synchronized every 5 seconds.

Show raw api
{
    "functions": [
        {
            "name": "SetRobloxDataStore",
            "desc": "Injects the underlying datastore to use instead of resolving a real one. Accepts a real\ndatastore or a [DataStoreMock]. Intended for testing; must be called before the datastore\nis first resolved.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "GameDataStoreService"
                },
                {
                    "name": "robloxDataStore",
                    "desc": "",
                    "lua_type": "DataStore | DataStoreMock"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 47,
                "path": "src/datastore/src/Server/GameDataStoreService.lua"
            }
        },
        {
            "name": "PromiseDataStore",
            "desc": "Promises a DataStore for the current game that is synchronized every 5 seconds.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "GameDataStoreService"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<DataStore>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 59,
                "path": "src/datastore/src/Server/GameDataStoreService.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "GameDataStoreService",
    "desc": "Service which manages central access to datastore. This datastore will refresh pretty frequently and\ncan be used for configuration and other components, such as Twitter codes or global settings.",
    "realm": [
        "Server"
    ],
    "source": {
        "line": 9,
        "path": "src/datastore/src/Server/GameDataStoreService.lua"
    }
}