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

# compareinstances

> 比较两个 Instance object 值中存储的内部 Instance 指针值。

<div className="real-function-page">
  ```lua theme={null}
  compareinstances(first: Instance, second: Instance): boolean
  ```

  ## 参数

  <ParamField path={"first"} type={"Instance"} required>
    要比较的第一个 Instance object。
  </ParamField>

  <ParamField path={"second"} type={"Instance"} required>
    要比较的第二个 Instance object。
  </ParamField>

  ## 返回值

  <ResponseField name={"equal"} type={"boolean"}>
    当两个 Instance object 值包含相同的内部指针值时返回 True。
  </ResponseField>

  ## 示例

  比较两个 Instance object 值中存储的内部 Instance 指针值。

  ```lua theme={null}
  local Players = game:GetService("Players")
  local ReplicatedStorage = game:GetService("ReplicatedStorage")

  print(compareinstances(Players, Players))
  print(compareinstances(Players, ReplicatedStorage))
  ```
</div>
