Syntax
compareinstances(first: Instance, second: Instance): booleanArguments
| Name | Type | Description |
|---|---|---|
first | Instance | First Instance object to compare. |
second | Instance | Second Instance object to compare. |
Returns
| Name | Type | Description |
|---|---|---|
equal | boolean | True when both Instance object values contain the same underlying reference. |
Description
Compares the Instance references stored in two Instance object values.
Call it with 2 parameter(s): first, second. The argument table explains which values are required and which ones only refine the behavior.
It returns equal (boolean). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Compare the underlying Instance references.
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
print(compareinstances(Players, Players))
print(compareinstances(Players, ReplicatedStorage))