Skip to content

sethiddenproperty

Avoid relying on setscriptable to implement this function

Some executors implement this function using setscriptable, which is limited and/or detectable.

sethiddenproperty assigns a value to a hidden or non-scriptable property of an Instance, even if that property is normally read-only or inaccessible.

It returns true if the property is hidden and was successfully written to, or false if the property wasn't hidden but was still updated.

function sethiddenproperty(instance: Instance, property_name: string, property_value: any): boolean

Parameters

Parameter Description
instance The instance that owns the target property.
property_name The name of the property to update.
property_value The new value to assign to the property.

Example

Setting a hidden property value
1
2
3
4
5
6
7
local part = Instance.new("Part")

print(gethiddenproperty(part, "DataCost")) -- Output: 20, true

sethiddenproperty(part, "DataCost", 100)

print(gethiddenproperty(part, "DataCost")) -- Output: 100, true