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

# run_on_thread

> Runs Luau source on a specific Luau thread. Extra arguments after source are passed to the dispatched source when supported. The call returns no values and does not return values produced by the dispatched source. runonthread is an alias.

<div className="real-function-page">
  ```lua theme={null}
  run_on_thread(thread: thread, source: string, ...arguments?: ...any)
  ```

  ## Alias

  * `runonthread`

  ## Đối số

  <ParamField path={"thread"} type={"thread"} required>
    Target Luau thread used to run the source.
  </ParamField>

  <ParamField path={"source"} type={"string"} required>
    Non-empty Luau source string to run on the target thread.
  </ParamField>

  <ParamField path={"...arguments"} type={"...any"}>
    Additional values passed to the dispatched source when supported. Unsupported values are passed as nil.
  </ParamField>

  ## Ví dụ

  Run source on a target Luau thread.

  ```lua theme={null}
  local thread = getactorthreads()[1]

  if thread then
      run_on_thread(thread, [[
          print(getcurrentactor())
      ]])
  end
  ```
</div>
