sunc docs
  • sUNC Introduction
  • Closures
    • hookfunction
    • hookmetamethod
    • newcclosure
    • iscclosure
    • islclosure
    • isexecutorclosure
    • clonefunction
    • getfunctionhash
  • Cryptography
    • crypt.base64encode
    • crypt.base64decode
  • Debug
    • debug.getconstants
    • debug.getconstant
    • debug.setconstant
    • debug.getupvalues
    • debug.getupvalue
    • debug.setupvalue
  • debug.getstack
  • debug.setstack
  • debug.getprotos
  • debug.getproto
  • Drawing
    • Drawing.new
      • Drawing Objects
    • cleardrawcache
    • getrenderproperty
    • setrenderproperty
    • isrenderobj
  • Environment
    • getgenv
    • getrenv
    • getgc
    • filtergc
  • Filesystem
    • appendfile
    • writefile
    • readfile
    • listfiles
    • isfile
    • delfile
    • loadfile
    • makefolder
    • isfolder
    • delfolder
    • getcustomasset
  • Instances
    • fireproximityprompt
    • fireclickdetector
    • firetouchinterest
    • getinstances
    • getnilinstances
    • cloneref
    • gethui
    • getcallbackvalue
    • compareinstances
  • Metatables
    • getrawmetatable
    • setrawmetatable
    • setreadonly
    • isreadonly
  • Miscellaneous
    • identifyexecutor
    • request
  • Reflection
    • gethiddenproperty
    • sethiddenproperty
    • setscriptable
    • checkcaller
    • setthreadidentity
    • getthreadidentity
  • Scripts
    • getscriptbytecode
    • getscripthash
    • getscriptclosure
    • getsenv
    • getscripts
    • getrunningscripts
    • getloadedmodules
    • getcallingscript
    • loadstring
  • Signals
    • getconnections
      • The Connection object
    • firesignal
    • replicatesignal
  • Websocket
    • WebSocket.connect
Powered by GitBook
On this page
  • Parameters
  • Example
  1. Reflection

setscriptable

This function exposes detection vectors, as game scripts can check whether they can also index those properties.

This function is limited, meaning you won't be able to use it on all the hidden properties; use gethiddenproperty for those instead.

Sets a hidden property scriptable, which means you will be able to index the hidden properties as if they weren't hidden.

function setscriptable(object: Instance, property: string, state: boolean): boolean | nil

Parameters

  • object - The instance's property to set scriptable.

  • property - The wanted property to set scriptable.

  • state - Whether to turn it scriptable (true) or non-scriptable (false).


Example

local a = Instance.new("Part")
setscriptable(a, "BottomParamA", true)
print(a.BottomParamA) -- Output: -0.5
setscriptable(a, "BottomParamA", false)
print(a.BottomParamA) -- Throws an error
PrevioussethiddenpropertyNextcheckcaller

Last updated 2 months ago