> ## 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

> Auxiliares de reflexão para instâncias e propriedades.

<div className="real-category-page">
  Auxiliares de reflexão para instâncias e propriedades.

  ## Funções disponíveis

  <CardGroup cols={2}>
    <Card title="gethiddenproperty" href="./gethiddenproperty">
      Le uma Roblox property por reflection metadata, incluindo non-scriptable properties. O primeiro argumento deve ser Instance object e o segundo argumento deve ser um string property name. O instance reference deve ser valido. Se o property descriptor estiver ausente em Roblox property metadata, a function retorna apenas nil. Se o descriptor existir mas nao resolver para um property entry, gera "Not a property". Para reflection types Bool, Int, Float, Double, String, SystemAddress, SharedString e Vector3, a function chama o getter e retorna o value mais um boolean igual a !IsScriptable(). SystemAddress retorna RemoteId.PeerId como integer. SharedString retorna Content como string. Vector3 le do instance primitive Size offset e gera "can't get value" se o touch data estiver ausente. Outros property types sao lidos por normal Lua field access apos definir temporariamente o property scriptable flag como true; BinaryString e tratado temporariamente como String nessa leitura. O original scriptable flag e o BinaryString type sao restaurados antes de retornar.
    </Card>

    <Card title="isscriptable" href="./isscriptable">
      Verifica o scriptable flag de uma Roblox property em uma Instance. A function primeiro retorna um valor scriptable em cache quando ele existe para o mesmo instance reference e property name. Em um cache miss, o property name e resolvido por Roblox property metadata e pelo Instance class descriptor. Se nenhum descriptor existir, ou se o field resolvido estiver ausente ou nao for uma property entry, a function retorna nil. Quando uma property entry e encontrada, ela le scriptable state, armazena esse valor no scriptable override cache para a instance e a property, e retorna o boolean. A function nao altera o scriptable flag.
    </Card>

    <Card title="sethiddenproperty" href="./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.
    </Card>

    <Card title="setscriptable" href="./setscriptable">
      Armazena um scriptable override para uma Roblox property no scriptable override cache e retorna o previous scriptable state. O primeiro argumento deve ser Instance object, o segundo argumento deve ser um string property name, e o terceiro argumento deve ser boolean. Se um cache entry ja existir para o mesmo instance reference e property name, o cached scriptable value e substituido e o valor antigo do cache e retornado. Em um cache miss, o property name e resolvido por Roblox property metadata e pelo Instance class descriptor. Se nenhum descriptor existir, ou se o field resolvido estiver ausente ou nao for uma property entry, a function retorna nil. Quando uma property entry e encontrada, a function le scriptable state, armazena o boolean solicitado mais o property reference no scriptable override cache, e retorna o previous scriptable state value. GameIndexHook e GameNewIndexHook usam esse cache depois, definindo temporariamente o property field scriptable flag para uma unica leitura ou escrita indexed, e entao restaurando o previous field flag.
    </Card>
  </CardGroup>
</div>
