Skip to main content

TagUtils

Wrapper for collection service to make it easier to work with tags.

Functions

OnInstanceAdded

TagUtils.OnInstanceAdded(
tagstring,--

The tag to listen for.

callback(instanceInstance) → ()--

The callback to call when an instance with the tag is added.

) → ()

Wraps around GetInstanceAddedSignal and calls the callback for all existing instances with the tag as well.

OnInstanceRemoved

TagUtils.OnInstanceRemoved(
tagstring,--

The tag to listen for.

callback(instanceInstance) → ()--

The callback to call when an instance with the tag is removed.

) → ()

Wraps around GetInstanceRemovedSignal.

Show raw api
{
    "functions": [
        {
            "name": "OnInstanceAdded",
            "desc": "Wraps around `GetInstanceAddedSignal` and calls the callback for all existing instances with the tag as well.",
            "params": [
                {
                    "name": "tag",
                    "desc": "The tag to listen for.",
                    "lua_type": "string"
                },
                {
                    "name": "callback",
                    "desc": "The callback to call when an instance with the tag is added.",
                    "lua_type": "(instance: Instance) -> ()"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 18,
                "path": "src/Packages/TagUtils/init.luau"
            }
        },
        {
            "name": "OnInstanceRemoved",
            "desc": "Wraps around `GetInstanceRemovedSignal`.",
            "params": [
                {
                    "name": "tag",
                    "desc": "The tag to listen for.",
                    "lua_type": "string"
                },
                {
                    "name": "callback",
                    "desc": "The callback to call when an instance with the tag is removed.",
                    "lua_type": "(instance: Instance) -> ()"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 33,
                "path": "src/Packages/TagUtils/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "TagUtils",
    "desc": "Wrapper for collection service to make it easier to work with tags.",
    "source": {
        "line": 6,
        "path": "src/Packages/TagUtils/init.luau"
    }
}