Skip to main content

InstanceUtils

WARNING

Functions like WaitForChildWithAttributeSetTo will NOT work if you set the attribute after it is re-parented. This means that the thing you are waiting for needs to have the attribute already set when it gets parented.

Functions

WaitForChildWhichIsA

InstanceUtils.WaitForChildWhichIsA(
instanceInstance,
classstring
) → ()

Wait for a child which is of class class (Does a :IsA() check).

WaitForChildWithAttributeSetTo

InstanceUtils.WaitForChildWithAttributeSetTo(
instanceInstance,
attributestring,
valueTypeUtils.PossibleAttributeValue
) → ()

Waits for a child which has the attribute set to value. Note that if the attribute is set after the child is added it will not work as intended. The attribute must already exist before the parent is set to instance.

Show raw api
{
    "functions": [
        {
            "name": "WaitForChildWhichIsA",
            "desc": "Wait for a child which is of class `class` (Does a `:IsA()` check).",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "class",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 37,
                "path": "packages/instance_utils/source/init.luau"
            }
        },
        {
            "name": "WaitForChildWithAttributeSetTo",
            "desc": "Waits for a child which has the `attribute` set to `value`. Note that if the attribute is set after the child is added\nit will not work as intended. The attribute must already exist before the parent is set to `instance`.",
            "params": [
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "attribute",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "TypeUtils.PossibleAttributeValue\n"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 47,
                "path": "packages/instance_utils/source/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "InstanceUtils",
    "desc": ":::warning\nFunctions like `WaitForChildWithAttributeSetTo` will NOT work if you set the attribute after it is re-parented.\nThis means that the thing you are waiting for needs to have the attribute already set when it gets parented.\n:::",
    "source": {
        "line": 32,
        "path": "packages/instance_utils/source/init.luau"
    }
}