ReferenceReflection

setscriptable

Allows or blocks script access to a property on one Instance.

Syntax

setscriptable(object: Instance, property: string, scriptable: boolean) -> boolean?

Also available as

set_scriptable

Parameters

ParameterTypeDescription
objectInstanceAn Instance of the class that defines the property.
propertystringThe property name.
scriptablebooleantrue to allow script access, false to hide it.

Returns

TypeDescription
boolean?Whether the property was scriptable on this Instance before the call, or nil when the class has no such property.

Description

The change applies to the Instance you pass, not to every object of its class. After the call, ordinary indexing such as part.SomeHiddenProperty reads and writes the property on that object. Setting it back to its original value removes the override.

Example

local player = game.Players.LocalPlayer
local was = setscriptable(player, "SimulationRadius", true)
print(player.SimulationRadius)
setscriptable(player, "SimulationRadius", was)

Notes

These are Game executor contracts. Check build requirements and session lifetimes before using them.