sethiddenproperty Synchronous
sethiddenprop
Write a reflected property and report whether its native descriptor is hidden. Use it only when you know the property and value expected by that Instance class.
Luau
sethiddenproperty(instance: Instance, property: string, value: any) -> booleanParameters
| Parameter | Type | Description |
|---|---|---|
instance | Instance | Instance whose reflected property will be written. |
property | string | Case-sensitive property name. |
value | any | New value of the property’s native type. |
Returns
booleanA boolean indicating whether the property’s native descriptor is hidden; it does not report whether the value changed.
Usage notes
An unknown, protected, or incompatible property raises an error. Save and restore a previous value if the change is temporary.
Example
Luau
local part = Instance.new("Part")
local before = part.CanCollide
local ok, hidden = pcall(sethiddenproperty, part, "CanCollide", false)
if ok then
print("Native property hidden:", hidden)
part.CanCollide = before
end
part:Destroy()