Skip to main content

ModuleSystem

This item only works when running on the server. Server

Internal module only to be used by Axis itself

Types

Module

interface Module {
Namestring
Clienttable?
AxisNetworkingany
[any]any
}

Properties

Modules

This item is read only and cannot be modified. Read Only
ModuleSystem.Modules: {[string]:any}}

Started

This item is read only and cannot be modified. Read Only
ModuleSystem.Started: boolean

Functions

Create

ModuleSystem.Create(ModuleDefModuleDefinition) → Module

Types

interface ModuleDefinition {
Namestring
Clienttable?
[any]any
}

Create a module

GetModule

ModuleSystem.GetModule(Namestring) → Module

Returns the module with that name

Errors

TypeDescription
"Name must be a string"The passed name is not a string
"Could not find module ..."A module does not exist with the passed name

Add

ModuleSystem:Add(ModuleScriptModuleScript) → ()

Add a module to the module list

Exists

ModuleSystem:Exists(Namestring) → boolean

Checks wether a module exists by name

Show raw api
{
    "functions": [
        {
            "name": "Add",
            "desc": "Add a module to the module list",
            "params": [
                {
                    "name": "ModuleScript",
                    "desc": "",
                    "lua_type": "ModuleScript"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 40,
                "path": "Axis/Core/ModuleSystem.luau"
            }
        },
        {
            "name": "Exists",
            "desc": "Checks wether a module exists by name",
            "params": [
                {
                    "name": "Name",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 50,
                "path": "Axis/Core/ModuleSystem.luau"
            }
        },
        {
            "name": "Create",
            "desc": "Create a module",
            "params": [
                {
                    "name": "ModuleDef",
                    "desc": "",
                    "lua_type": "ModuleDefinition"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Module"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 65,
                "path": "Axis/Core/ModuleSystem.luau"
            }
        },
        {
            "name": "Start",
            "desc": "Initializes and starts all added modules",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise"
                }
            ],
            "function_type": "method",
            "private": true,
            "source": {
                "line": 92,
                "path": "Axis/Core/ModuleSystem.luau"
            }
        },
        {
            "name": "GetModule",
            "desc": "Returns the module with that name",
            "params": [
                {
                    "name": "Name",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Module"
                }
            ],
            "function_type": "static",
            "errors": [
                {
                    "lua_type": "\"Name must be a string\"",
                    "desc": "The passed name is not a string"
                },
                {
                    "lua_type": "\"Could not find module ...\"",
                    "desc": "A module does not exist with the passed name"
                }
            ],
            "source": {
                "line": 163,
                "path": "Axis/Core/ModuleSystem.luau"
            }
        }
    ],
    "properties": [
        {
            "name": "Modules",
            "desc": "",
            "lua_type": "{[string] :any}}",
            "readonly": true,
            "source": {
                "line": 27,
                "path": "Axis/Core/ModuleSystem.luau"
            }
        },
        {
            "name": "Started",
            "desc": "",
            "lua_type": "boolean",
            "readonly": true,
            "source": {
                "line": 34,
                "path": "Axis/Core/ModuleSystem.luau"
            }
        }
    ],
    "types": [
        {
            "name": "ModuleDefinition",
            "desc": "",
            "fields": [
                {
                    "name": "Name",
                    "lua_type": "string",
                    "desc": ""
                },
                {
                    "name": "Client",
                    "lua_type": "table?",
                    "desc": ""
                },
                {
                    "name": "[any]",
                    "lua_type": "any",
                    "desc": ""
                }
            ],
            "source": {
                "line": 17,
                "path": "Axis/Core/Types.luau"
            }
        },
        {
            "name": "Module",
            "desc": "",
            "fields": [
                {
                    "name": "Name",
                    "lua_type": "string",
                    "desc": ""
                },
                {
                    "name": "Client",
                    "lua_type": "table?",
                    "desc": ""
                },
                {
                    "name": "AxisNetworking",
                    "lua_type": "any",
                    "desc": ""
                },
                {
                    "name": "[any]",
                    "lua_type": "any",
                    "desc": ""
                }
            ],
            "source": {
                "line": 31,
                "path": "Axis/Core/Types.luau"
            }
        }
    ],
    "name": "ModuleSystem",
    "desc": "Internal module only to be used by Axis itself",
    "realm": [
        "Server"
    ],
    "source": {
        "line": 7,
        "path": "Axis/Core/ModuleSystem.luau"
    }
}