isscriptable

Checks if a property is scriptable.

Syntax

isscriptable(object: Object, property: string) -> boolean

Parameters

ParameterTypeDescription
objectObjectThe object, including an Instance
propertystringThe property name

Returns

TypeDescription
booleanWhether the property is currently scriptable

Description

isscriptable checks whether a property is scriptable. An invalid property name raises an error.

Example

local part = Instance.new("Part")

-- Check common properties
print(isscriptable(part, "Name"))     -- true (visible)
print(isscriptable(part, "Position")) -- true (visible)
print(isscriptable(part, "size_xml")) -- false (hidden)

Use Case

local function getAllProperties(instance)
    local properties = {}

    -- Check a list of known property names
    local propertyNames = {"Name", "Position", "Size", "Color", "size_xml"}

    for _, propName in ipairs(propertyNames) do
        local scriptable = isscriptable(instance, propName)
        properties[propName] = {
            scriptable = scriptable,
            value = scriptable and instance[propName] or gethiddenproperty(instance, propName)
        }
    end

    return properties
end