isscriptable
Checks if a property is scriptable.
Syntax
isscriptable(instance: Instance, property: string) -> booleanParameters
| Parameter | Type | Description |
|---|---|---|
instance | Instance | The instance |
property | string | The property name |
Returns
| Type | Description |
|---|---|
boolean | true 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
endRelated Functions
setscriptable- Change scriptabilitygethiddenproperty- Get hidden property values