Skip to main content

InstanceList

A list of Instances that are allowed or disallowed in the sandbox.

You can use this to check if an Instance is allowed or disallowed in the sandbox, or if an Instance or RBXScriptSignal is wrapped or not.

Properties

DisallowedClasses

This item is read only and cannot be modified. Read Only
InstanceList.DisallowedClasses: {string}

A list of classes that are not allowed to be created by Instance.new nor Instance.fromExisting.

Items can be added to the list, but it cannot be overwritten.

Changes to this list will be reflected in the sandbox, even if they are made after the sandbox has been initialized. However, if an Instance of a disallowed class is already created, it will continue to function as normal.

ForbiddenClasses

This item is read only and cannot be modified. Read Only
InstanceList.ForbiddenClasses: {string}

A list of classes that are not allowed to be accessed via the sandbox, period. Every time an Instance reference is accessed, its class will be checked against this list, respecting inheritance by using IsA. If it matches any of the classes in this list, nil will be returned instead.

Items can be added to the list, but it cannot be overwritten.

Changes to this list will be reflected in the sandbox, even if they are made after the sandbox has been initialized. However, if an Instance of a forbidden class is already referenced in a variable it will continue to function as normal.

ExplicitDisallow

This item is read only and cannot be modified. Read Only
InstanceList.ExplicitDisallow: {[Instance]boolean}

A list of Instances that are explicitly disallowed in the sandbox. This is a mapping of Instances to boolean values, which indicate whether the Instance's descendants are allowed or not.

Items can be added to the list, but it cannot be overwritten.

Changes to this list will be reflected in the sandbox, even if they are made after the sandbox has been initialized. However, if a blocked Instance is already wrapped, it will continue to function as normal.

Allow

This item is read only and cannot be modified. Read Only
InstanceList.Allow: {[Instance]boolean}

A list of Instances that are allowed in the sandbox. This is a mapping of Instances to boolean values, which indicate whether the Instance's descendants are allowed or not.

If any Instance is present in this list, but it is disallowed in ExplicitDisallow, it will be disallowed in the sandbox.

Items can be added to the list, but it cannot be overwritten.

Changes to this list will be reflected in the sandbox, even if they are made after the sandbox has been initialized. However, if a blocked Instance is already wrapped, it will continue to function as normal.

Functions

instanceAllowed

InstanceList.instanceAllowed(
instInstance--

The Instance to check.

) → boolean

Checks if an Instance is allowed in the sandbox based on Allow, ExplicitDisallow, and ForbiddenClasses.

Show raw api
{
    "functions": [
        {
            "name": "instanceAllowed",
            "desc": "Checks if an `Instance` is allowed in the sandbox based on\n`Allow`, `ExplicitDisallow`, and `ForbiddenClasses`.",
            "params": [
                {
                    "name": "inst",
                    "desc": "The `Instance` to check.",
                    "lua_type": "Instance"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 137,
                "path": "src/InstanceList.luau"
            }
        }
    ],
    "properties": [
        {
            "name": "DisallowedClasses",
            "desc": "A list of classes that are not allowed to be created by\n`Instance.new` nor `Instance.fromExisting`.\n\nItems can be added to the list, but it cannot be overwritten.\n\nChanges to this list will be reflected in the sandbox, even if\nthey are made after the sandbox has been initialized. However,\nif an `Instance` of a disallowed class is already created,\nit will continue to function as normal.",
            "lua_type": "{string}",
            "readonly": true,
            "source": {
                "line": 50,
                "path": "src/InstanceList.luau"
            }
        },
        {
            "name": "ForbiddenClasses",
            "desc": "A list of classes that are not allowed to be accessed\nvia the sandbox, period. Every time an `Instance` reference\nis accessed, its class will be checked against this list, \nrespecting inheritance by using `IsA`. If it matches any of \nthe classes in this list, `nil` will be returned instead.\n\nItems can be added to the list, but it cannot be overwritten.\n\nChanges to this list will be reflected in the sandbox, even if\nthey are made after the sandbox has been initialized. However,\nif an `Instance` of a forbidden class is already referenced in\na variable it will continue to function as normal.",
            "lua_type": "{string}",
            "readonly": true,
            "source": {
                "line": 71,
                "path": "src/InstanceList.luau"
            }
        },
        {
            "name": "ExplicitDisallow",
            "desc": "A list of `Instance`s that are explicitly disallowed in the sandbox.\nThis is a mapping of `Instance`s to boolean values, which indicate whether\nthe `Instance`'s descendants are allowed or not.\n\nItems can be added to the list, but it cannot be overwritten.\n\nChanges to this list will be reflected in the sandbox, even if\nthey are made after the sandbox has been initialized. However,\nif a blocked `Instance` is already wrapped, it will continue to\nfunction as normal.",
            "lua_type": "{ [Instance]: boolean }",
            "readonly": true,
            "source": {
                "line": 93,
                "path": "src/InstanceList.luau"
            }
        },
        {
            "name": "Allow",
            "desc": "A list of `Instance`s that are allowed in the sandbox.\nThis is a mapping of `Instance`s to boolean values, which indicate whether\nthe `Instance`'s descendants are allowed or not.\n\nIf any `Instance` is present in this list, but it is disallowed in `ExplicitDisallow`,\nit will be disallowed in the sandbox.\n\nItems can be added to the list, but it cannot be overwritten.\n\nChanges to this list will be reflected in the sandbox, even if\nthey are made after the sandbox has been initialized. However,\nif a blocked `Instance` is already wrapped, it will continue to\nfunction as normal.",
            "lua_type": "{ [Instance]: boolean }",
            "readonly": true,
            "source": {
                "line": 127,
                "path": "src/InstanceList.luau"
            }
        }
    ],
    "types": [],
    "name": "InstanceList",
    "desc": "A list of `Instance`s that are allowed or disallowed in the sandbox.\n\nYou can use this to check if an `Instance` is allowed or disallowed in the sandbox,\nor if an `Instance` or `RBXScriptSignal` is wrapped or not.",
    "source": {
        "line": 31,
        "path": "src/InstanceList.luau"
    }
}