Background Image

Object Id Source Code



Functions

Add Id

Add an id to the instance (|AddId|)[Instance:Instance]

  • Instance: Is the instance you want to add an id to

Id’s are indexed starting at 0


Get Id

Get the id of an instance (|GetId|)[Instance:Instance] -> number

  • Instance: Is the instance you want to get the id of


Check Id

Check if an instances Id matches a given Id (|CheckId|)[Instance:Instance][Id:number] -> boolean

  • Instance: Is the instance you want to check
  • Id: Is the Id you want to check to see if Instance has the same Id as the Id you gave



Example

local ObjectId = require(ObjectId) -- Require the module

ObjectId.AddId(part)

local Id = ObjectId.GetId(part)

print(ObjectId.CheckId(part, Id)) --> true
print(ObjectId.CheckId(part, 999)) --> false