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