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
| Parameter | Type | Description |
|---|---|---|
object | Instance | An Instance of the class that defines the property. |
property | string | The property name. |
scriptable | boolean | true to allow script access, false to hide it. |
Returns
| Type | Description |
|---|---|
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
- For a single read,
gethiddenpropertyavoids changing the flag at all.
These are Game executor contracts. Check build requirements and session lifetimes before using them.
