Skip to main content

FlagRegistry

Discovers flag Models, attaches ProximityPrompts, and applies nation textures.

Types​

PoleRecord​

interface PoleRecord {
mesh: MeshPart
model: Model
poleId: string
}

Registered flag pole handle.

Functions​

setOnRegistered​

FlagRegistry.setOnRegistered(callback: (PoleRecord) → ()) → ()

Sets a callback invoked whenever a pole is registered (including during init).

registerModel​

FlagRegistry.registerModel(model: Model) → PoleRecord?

Registers a single flag Model (idempotent by PoleId).

init​

FlagRegistry.init() → ()

Scans the configured flag folder and CollectionService tag.

get​

FlagRegistry.get(poleId: string) → PoleRecord?

count​

FlagRegistry.count() → number

applyNation​

FlagRegistry.applyNation(
record: PoleRecord,
nationId: string
) → boolean—falseifnationmissingorhasemptytexture

Sets MeshPart.TextureID and updates CurrentNation / prompt ObjectText.

Show raw api
{
    "functions": [
        {
            "name": "setOnRegistered",
            "desc": "Sets a callback invoked whenever a pole is registered (including during `init`).",
            "params": [
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "(PoleRecord) -> ()"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 108,
                "path": "src/ServerScriptService/NationFlagSystem/FlagRegistry.luau"
            }
        },
        {
            "name": "registerModel",
            "desc": "Registers a single flag Model (idempotent by `PoleId`).",
            "params": [
                {
                    "name": "model",
                    "desc": "",
                    "lua_type": "Model"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "PoleRecord?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 119,
                "path": "src/ServerScriptService/NationFlagSystem/FlagRegistry.luau"
            }
        },
        {
            "name": "init",
            "desc": "Scans the configured flag folder and CollectionService tag.",
            "params": [],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 176,
                "path": "src/ServerScriptService/NationFlagSystem/FlagRegistry.luau"
            }
        },
        {
            "name": "get",
            "desc": "",
            "params": [
                {
                    "name": "poleId",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "PoleRecord?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 213,
                "path": "src/ServerScriptService/NationFlagSystem/FlagRegistry.luau"
            }
        },
        {
            "name": "count",
            "desc": "",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 221,
                "path": "src/ServerScriptService/NationFlagSystem/FlagRegistry.luau"
            }
        },
        {
            "name": "applyNation",
            "desc": "Sets MeshPart.TextureID and updates `CurrentNation` / prompt ObjectText.",
            "params": [
                {
                    "name": "record",
                    "desc": "",
                    "lua_type": "PoleRecord"
                },
                {
                    "name": "nationId",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean — false if nation missing or has empty texture"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 237,
                "path": "src/ServerScriptService/NationFlagSystem/FlagRegistry.luau"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "PoleRecord",
            "desc": "Registered flag pole handle.",
            "fields": [
                {
                    "name": "mesh",
                    "lua_type": "MeshPart",
                    "desc": ""
                },
                {
                    "name": "model",
                    "lua_type": "Model",
                    "desc": ""
                },
                {
                    "name": "poleId",
                    "lua_type": "string",
                    "desc": ""
                },
                {
                    "name": "prompt",
                    "lua_type": "ProximityPrompt",
                    "desc": ""
                }
            ],
            "source": {
                "line": 20,
                "path": "src/ServerScriptService/NationFlagSystem/FlagRegistry.luau"
            }
        }
    ],
    "name": "FlagRegistry",
    "desc": "Discovers flag Models, attaches ProximityPrompts, and applies nation textures.",
    "source": {
        "line": 31,
        "path": "src/ServerScriptService/NationFlagSystem/FlagRegistry.luau"
    }
}