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

# Closures

> Verschlüsse prüfen, erstellen, klonen und ersetzen.

<div className="real-category-page">
  Verschlüsse prüfen, erstellen, klonen und ersetzen.

  ## Verfügbare Funktionen

  <CardGroup cols={2}>
    <Card title="checkcaller" href="./checkcaller">
      Gibt zurück, ob der current Luau thread in Real caller context vorhanden ist. Die function nimmt keine arguments und pusht das boolean result von the current caller context. Die function untersucht weder den Lua call stack noch ein function object.
    </Card>

    <Card title="clonefunction" href="./clonefunction">
      Creates and returns a separate function value for the function passed as the first argument. The argument must be a function.
    </Card>

    <Card title="comparefunctions" href="./comparefunctions">
      Vergleicht zwei function values über ihren function identity. Beide arguments müssen functions sein. Die function gibt das boolean result von function identity(L, 1) == function identity(L, 2) zurück. Sie vergleicht kein function bytecode, source, behavior, hashes, upvalues oder newcclosure mappings. comparefunction ist ein alias für dieselbe function.
    </Card>

    <Card title="getfunctionhash" href="./getfunctionhash">
      Returns an uppercase SHA384 hex digest derived from a Luau function. The argument must be a function, and C closures raise "Lua function expected". If no hashable function content is available, the function returns nil.
    </Card>

    <Card title="hookfunction" href="./hookfunction">
      Hookt eine target function mit einer replacement function und gibt eine cloned copy der original target closure zurück. Beide arguments müssen functions sein. Die function flusht zuerst pending C function swaps, cloned den target über function cloning, fügt die replacement closure oder ihr mapped newcclosure target zu hidden stack tracking hinzu, ruft FixCallstack für target und cloned original auf und patcht dann die target closure über den C closure, Luau closure oder newcclosure-specific path. Wenn target noch nicht in hook records ist, wird das cloned original dort für restorefunction gespeichert. Die returned function ist die cloned original closure.
    </Card>

    <Card title="hookmetamethod" href="./hookmetamethod">
      Sucht eine metamethod function auf einem value und hookt diese function über hookfunction. Das first argument kann jeder value sein, den raw metafield lookup akzeptiert. Das second argument muss ein string metamethod name sein, und das third argument muss eine function replacement sein. Wenn raw metafield lookup das named metafield nicht findet, löst die function "Metamethod doesn't exist" für argument 2 aus. Wenn das metafield existiert, aber keine function ist, löst sie "Metamethod isn't a function" für argument 2 aus. Wenn das metafield eine function ist, ruft hookmetamethod hookfunction mit der found metamethod function als target auf und gibt die cloned original closure von hookfunction zurück.
    </Card>

    <Card title="iscclosure" href="./iscclosure">
      Returns whether the provided function is a C closure. The argument must be a function; passing any other type raises a type error. The function does not inspect executor ownership, source, bytecode, or upvalues.
    </Card>

    <Card title="isexecutorclosure" href="./isexecutorclosure">
      Returns whether the provided function is classified as executor-owned. The argument must be a function. The function does not inspect source text, debug names, bytecode hashes, or call stack ownership.
    </Card>

    <Card title="isfunctionhooked" href="./isfunctionhooked">
      Returns whether the provided function currently has a hook record. The argument must be a function.
    </Card>

    <Card title="ishiddenstack" href="./ishiddenstack">
      Returns whether a function, or the function at a stack level, is marked as hidden. target must be a function or stack level number. Invalid stack levels raise "Level out of range". isstackhidden is an alias.
    </Card>

    <Card title="islclosure" href="./islclosure">
      Returns whether the provided function is a Lua closure. The argument must be a function; passing a non-function raises a type error. isluaclosure is an alias.
    </Card>

    <Card title="isnewcclosure" href="./isnewcclosure">
      Returns whether the provided function is a newcclosure-created C closure. The first argument must be a function; passing a non-function raises a type error. Documented usage is a single function argument; extra arguments are not part of the supported signature.
    </Card>

    <Card title="newcclosure" href="./newcclosure">
      Returns a C closure for the provided function. If the function is already a C closure, the same function is returned. Passing a non-function raises a type error.
    </Card>

    <Card title="newlclosure" href="./newlclosure">
      Returns a Luau closure that calls the provided function. The first argument must be a function.
    </Card>

    <Card title="restorefunction" href="./restorefunction">
      Stellt eine function wieder her oder ersetzt sie, indem intern function hook operation aufgerufen wird, und gibt keine values zurück. Das first argument muss eine function sein. Mit einem function argument sucht die function nach the saved original function; wenn kein entry existiert, löst sie "Function is not hooked" aus. Dann ruft sie function hook operation mit der hooked closure und der stored original closure auf, leert den Lua stack und entfernt die restored closure aus hook records, wenn das stored original verwendet wurde. Wenn das second argument ebenfalls eine function ist, behandelt die function firstFunction stattdessen als die zu installierende original function und secondFunction als die zu patchende closure. In dieser Form wird kein missing-original check gegen den gespeicherten hook records-Wert durchgeführt; der gespeicherte Wert wird nur beim final remove check verglichen. verwendet. Non-function second arguments werden von der branch condition ignoriert. restorefunc und restoreclosure sind aliases für dieselbe function.
    </Card>

    <Card title="sethiddenstack" href="./sethiddenstack">
      Marks or unmarks a function, or the function at a stack level, as hidden. target must be a function or stack level number. hidden defaults to true. Invalid stack levels raise "Level out of range". setstackhidden is an alias.
    </Card>
  </CardGroup>
</div>
