Volt

isscriptable

Checks if a property is scriptable.

Syntax

isscriptable(instance: Instance, property: string) -> boolean

Parameters

ParameterTypeDescription
instanceInstanceThe instance
propertystringThe property name

Returns

TypeDescription
booleantrue if the property is scriptable

Description

isscriptable checks whether a property can be accessed through scripts. Non-scriptable properties are hidden from the scripting API.

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

On this page