Skip to main content

DataControllerService

Types

DataControllerService

interface DataControllerService {
CreateDataController(playerPlayer) → DataController?
FindDataController(playerPlayer) → DataController?
WaitForDataController(playerPlayer) → DataController?
}

Functions

CreateDataController

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
DataControllerService.CreateDataController(playerPlayer) → DataController?
caution
test admonition

Creates DataController and Profile for Player.

FindDataController

DataControllerService.FindDataController(playerPlayer) → DataController?

Fetches DataController attached to Player if one exists.

WaitForDataController

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
DataControllerService.WaitForDataController(playerPlayer) → DataController?

Yields until DataController attached to Player is loaded.

Show raw api
{
    "functions": [
        {
            "name": "LoadPlayerProfile",
            "desc": "Creates ProfileService Profile for `player`.",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Profile?"
                }
            ],
            "function_type": "static",
            "private": true,
            "yields": true,
            "source": {
                "line": 49,
                "path": "src/ServerScriptService/Modules/DataControllers.luau"
            }
        },
        {
            "name": "GetPositionInPart",
            "desc": "Generates random position within part bounds.",
            "params": [
                {
                    "name": "part",
                    "desc": "",
                    "lua_type": "BasePart"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Vector3"
                }
            ],
            "function_type": "static",
            "private": true,
            "source": {
                "line": 73,
                "path": "src/ServerScriptService/Modules/DataControllers.luau"
            }
        },
        {
            "name": "OnDataRequest",
            "desc": "Sends [DataController] data based on `requestType`.",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "requestType",
                    "desc": "",
                    "lua_type": "DataRequestType"
                }
            ],
            "returns": [],
            "function_type": "static",
            "private": true,
            "source": {
                "line": 91,
                "path": "src/ServerScriptService/Modules/DataControllers.luau"
            }
        },
        {
            "name": "CreateDataController",
            "desc": ":::caution \n\n\ttest admonition\n\n:::\n\nCreates [DataController] and [Profile](#Profile) for `Player`.",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DataController?"
                }
            ],
            "function_type": "static",
            "yields": true,
            "source": {
                "line": 130,
                "path": "src/ServerScriptService/Modules/DataControllers.luau"
            }
        },
        {
            "name": "FindDataController",
            "desc": "Fetches [DataController] attached to `Player` if one exists.",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DataController?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 171,
                "path": "src/ServerScriptService/Modules/DataControllers.luau"
            }
        },
        {
            "name": "WaitForDataController",
            "desc": "Yields until [DataController] attached to `Player` is loaded.",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "DataController?"
                }
            ],
            "function_type": "static",
            "yields": true,
            "source": {
                "line": 189,
                "path": "src/ServerScriptService/Modules/DataControllers.luau"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "DataControllerService",
            "desc": "",
            "fields": [
                {
                    "name": "CreateDataController",
                    "lua_type": "(player: Player) -> DataController?",
                    "desc": ""
                },
                {
                    "name": "FindDataController",
                    "lua_type": "(player: Player) -> DataController?",
                    "desc": ""
                },
                {
                    "name": "WaitForDataController",
                    "lua_type": "(player: Player) -> DataController?",
                    "desc": ""
                }
            ],
            "source": {
                "line": 114,
                "path": "src/ServerScriptService/Modules/DataControllers.luau"
            }
        }
    ],
    "name": "DataControllerService",
    "desc": "",
    "source": {
        "line": 106,
        "path": "src/ServerScriptService/Modules/DataControllers.luau"
    }
}