> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Reflection

> Reflection helpers for instances and properties.

Reflection helpers for instances and properties.

| Function navigation                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`gethiddenproperty`](./gethiddenproperty) | Reads a Roblox property with reflection metadata, including non-scriptable properties. The first argument must be Instance object and the second argument must be a string property name. The instance reference must be valid. If the property descriptor is missing from Roblox property metadata, the function returns only nil. If the descriptor exists but does not resolve to a property entry, it raises "Not a property". For Bool, Int, Float, Double, String, SystemAddress, SharedString, and Vector3 reflection types, the function calls the getter and returns the value plus a boolean equal to !IsScriptable(). SystemAddress returns RemoteId.PeerId as an integer. SharedString returns Content as a string. Vector3 reads from the instance primitive Size offset and raises "can't get value" if the touch data is missing. Other property types are read with normal Lua field access after temporarily setting the property scriptable flag to true; BinaryString is temporarily treated as String for that read. The original scriptable flag and BinaryString type are restored before returning. |
| [`isscriptable`](./isscriptable)           | Checks the scriptable flag for a Roblox property on an Instance. The function first returns a cached scriptable value when one exists for the same instance reference and property name. On a cache miss, the property name is resolved with Roblox property metadata and the Instance class descriptor. If no descriptor exists, or the resolved field is missing or is not a property entry, the function returns nil. When a property entry is found, it reads scriptable state, stores that value in the scriptable override cache for the instance and property, and returns the boolean. The function does not change the scriptable flag.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [`sethiddenproperty`](./sethiddenproperty) | Sets a Roblox property with reflection metadata. The first argument must be Instance object, the second argument must be a string property name, and the third argument must be present. The instance reference must be valid. If the property descriptor is missing from Roblox property metadata, the function returns nil. If the descriptor exists but does not resolve to a property entry, it raises "Not a property". Bool values use luaL\_checkboolean. Int and SystemAddress values use integer type checking, with SystemAddress writing RemoteId.PeerId. Float and Double values use number type checking. String, SharedString, and BinaryString values use string type checking before calling the setter. For other property types, the function temporarily calls setscriptable(instance, property, true), assigns instance\[property] = value with normal Lua field assignment, then restores the original scriptable state with setscriptable(instance, property, isScriptable). On successful writes, the return value is a boolean equal to !IsScriptable() from before the write.                     |
| [`setscriptable`](./setscriptable)         | Stores a scriptable override for a Roblox property in the scriptable override cache and returns the previous scriptable state. The first argument must be Instance object, the second argument must be a string property name, and the third argument must be boolean. If a cache entry already exists for the same instance reference and property name, the cached scriptable value is replaced and the old cached value is returned. On a cache miss, the property name is resolved with Roblox property metadata and the Instance class descriptor. If no descriptor exists, or the resolved field is missing or is not a property entry, the function returns nil. When a property entry is found, the function reads scriptable state, stores the requested boolean plus the property reference in scriptable override cache, and returns the previous scriptable state value. The GameIndexHook and GameNewIndexHook later use this cache by temporarily setting the property field scriptable flag for a single indexed read or write, then restoring the previous field flag.                                     |
