Equals

Constructor:

Equals(TarObj)

Description

Judges whether the target object is the same as itself.

Parameters

Variable name Type Default Description
TarObj RWObject Parent object specified for judgment

Return Value

Type Description
bool The judgment result returned, True or False

Examples

Create a part. Judge whether another part and this part are the same one or not by using Equals. If true, change the part color.

local temp = RWObject.Create("Part") -- create an instance "temp" of Part
temp.Position = Vector3.New(0,1,2) -- define the position of temp
temp.Name = "PP"
temp.Anchored = true -- temp is anchored
temp.Parent = WorkSpace
local temp2 = WorkSpace:WaitForChild("PP") -- retrieve the part
if temp:Equals(temp2) then -- judge whether it is the created part or not
    temp.Color = Vector3.New(255,0,128)
end