sethiddenproperty Synchronous
sethiddenprop
Write a reflected property on an Instance or Roblox Object and report whether its descriptor is hidden. Use it only when you know the property and value expected by that class.
Luau
sethiddenproperty(instance: Instance | Object, property: string, value: any) -> booleanParameters
| Parameter | Type | Description |
|---|---|---|
instance | Instance | Object | Instance or Roblox Object 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()