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

> So sanh cac gia tri reference Instance noi bo duoc luu trong hai gia tri Instance object.

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

  ## Đối số

  <ParamField path={"first"} type={"Instance"} required>
    Instance object thu nhat de so sanh.
  </ParamField>

  <ParamField path={"second"} type={"Instance"} required>
    Instance object thu hai de so sanh.
  </ParamField>

  ## Giá trị trả về

  <ResponseField name={"equal"} type={"boolean"}>
    True khi ca hai gia tri Instance object chua cung mot gia tri reference noi bo.
  </ResponseField>

  ## Ví dụ

  So sanh cac gia tri reference Instance noi bo duoc luu trong hai gia tri Instance object.

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

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