setscriptable
Toggles the scriptability flag of an Instance property.
function setscriptable(instanceinstanceInstanceThe target Instance.: Instance, propertypropertystringThe property to modify.: string, valuevaluebooleantrue to make the property scriptable.: boolean): booleanbooleanThe previous scriptability state of the property.Usage
Make a property scriptable
local wasScriptable = setscriptable(workspace.Terrain, "MaterialColors", true)
print(workspace.Terrain.MaterialColors) -- now readable
setscriptable(workspace.Terrain, "MaterialColors", wasScriptable) -- restore