Skip to main content

DataController

Types

DataController

interface DataController {
PlayerPlayer
ProfileProfile
EntityIdnumber
LoadedSignal
SpawnCharacter(
number
) → ()
IsLoaded(DataController) → ()
}

Functions

SpawnCharacter

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
DataController:SpawnCharacter(
delaynumber?--

The time to wait before loading character.

) → ()

Loads Player character. Calls Player:RequestStreamAroundAsync at spawn location.

IsLoaded

DataController:IsLoaded() → boolean

Checks if Profile has been fully loaded.

Destroy

DataController:Destroy() → ()

Releases player Profile and despawns player Entity.

Show raw api
{
    "functions": [
        {
            "name": "SpawnCharacter",
            "desc": "Loads Player character.\nCalls [Player:RequestStreamAroundAsync] at spawn location.",
            "params": [
                {
                    "name": "delay",
                    "desc": "The time to wait before loading character.",
                    "lua_type": "number?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "yields": true,
            "source": {
                "line": 228,
                "path": "src/ServerScriptService/Modules/DataControllers.luau"
            }
        },
        {
            "name": "IsLoaded",
            "desc": "Checks if [Profile](#Profile) has been fully loaded.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 265,
                "path": "src/ServerScriptService/Modules/DataControllers.luau"
            }
        },
        {
            "name": "Destroy",
            "desc": "Releases player [Profile](#Profile) and despawns player [Entity](#Entity).",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 275,
                "path": "src/ServerScriptService/Modules/DataControllers.luau"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "DataController",
            "desc": "",
            "fields": [
                {
                    "name": "Player",
                    "lua_type": "Player",
                    "desc": ""
                },
                {
                    "name": "Profile",
                    "lua_type": "Profile",
                    "desc": ""
                },
                {
                    "name": "EntityId",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "Loaded",
                    "lua_type": "Signal",
                    "desc": ""
                },
                {
                    "name": "SpawnCharacter",
                    "lua_type": "(DataController, number) -> ()",
                    "desc": ""
                },
                {
                    "name": "IsLoaded",
                    "lua_type": "(DataController) -> ()",
                    "desc": ""
                }
            ],
            "source": {
                "line": 218,
                "path": "src/ServerScriptService/Modules/DataControllers.luau"
            }
        }
    ],
    "name": "DataController",
    "desc": "",
    "source": {
        "line": 207,
        "path": "src/ServerScriptService/Modules/DataControllers.luau"
    }
}