setscriptable
Sets whether a property is scriptable.
Syntax
setscriptable(instance: Instance, property: string, scriptable: boolean) -> booleanParameters
| Parameter | Type | Description |
|---|---|---|
instance | Instance | The instance |
property | string | The property name |
scriptable | boolean | The new scriptability |
Returns
| Type | Description |
|---|---|
boolean | The previous scriptability |
Description
setscriptable changes whether a property is accessible through normal scripting. This can make hidden properties accessible via regular property access.
Example
local part = Instance.new("Part")
-- Make a hidden property scriptable
local wasScriptable = setscriptable(part, "size_xml", true)
-- Now we can access it normally
print(part.size_xml)
-- Restore original state
setscriptable(part, "size_xml", wasScriptable)Making Hidden Properties Accessible
local function exposeProperty(instance, propName)
local wasScriptable = setscriptable(instance, propName, true)
return function()
setscriptable(instance, propName, wasScriptable)
end
end
-- Use
local restore = exposeProperty(part, "size_xml")
print(part.size_xml) -- Now accessible
restore() -- Restore original stateRelated Functions
isscriptable- Check scriptabilitygethiddenproperty- Alternative for hidden properties