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

# getactorfromthread

> คืน Actor Instance ที่เชื่อมกับ Luau thread argument แรกต้องเป็น thread function อ่าน thread data ของ thread ต้องมี Actor reference และ positive container count จากนั้นอ่าน the associated Actor หาก actor weak reference valid จะ push เป็น Instance มิฉะนั้น function คืน nil

<div className="real-function-page">
  ```lua theme={null}
  getactorfromthread(thread: thread): Instance | nil
  ```

  ## Aliases

  * `getactorfromstate`

  ## Arguments

  <ParamField path={"thread"} type={"thread"} required>
    Luau thread ที่ต้องตรวจ thread data เพื่อหา associated Actor weak reference
  </ParamField>

  ## Returns

  <ResponseField name={"actor"} type={"Instance | nil"}>
    Actor Instance ที่ resolve จาก the associated Actor weak reference ของ thread หรือ nil เมื่อไม่มี valid actor reference
  </ResponseField>

  ## ตัวอย่าง

  Resolve the Actor Instance associated with a Luau thread, when that thread has a valid actor reference.

  ```lua theme={null}
  for _, thread in ipairs(getactorthreads()) do
      local actor = getactorfromthread(thread)
      print(actor)
  end
  ```
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.