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

# getthreadidentity

> Returns the identity for the current Luau thread, or for the first argument when that argument is a thread. Returned identities are 1 through 12; other stored values return 0.

<div className="real-function-page">
  ```lua theme={null}
  getthreadidentity(thread?: thread): integer
  ```

  ## エイリアス

  * `get_thread_identity`
  * `getidentity`
  * `getthreadcaps`
  * `getthreadcontext`
  * `get_thread_context`

  ## 引数

  <ParamField path={"thread"} type={"thread"}>
    Optional Luau thread to inspect. If omitted, or if the first argument is not a thread, the current thread is inspected.
  </ParamField>

  ## 戻り値

  <ResponseField name={"identity"} type={"integer"}>
    Thread identity from 1 through 12, or 0 for other stored values.
  </ResponseField>

  ## 例

  Read the identity from the current Luau thread, or from a thread argument when one is provided.

  ```lua theme={null}
  local currentIdentity = getthreadidentity()
  print(currentIdentity)

  local thread = coroutine.create(function()
  end)

  print(getthreadidentity(thread))
  ```
</div>
