InstanceEx | Get all properties of an instance and compare two instance's structural equality

InstanceEx

Setup instructions

This module requires the Full-Api-Dump.json under itself as a module script called FullAPIDumpJson. You can get the latest version’s api dump here,

API

  • InstanceEx.GetProperties(Object: Instance | string)

    Returns the properties of the passed instance or class name string.

  • InstanceEx.AreAssetsEqual(Asset1: Instance, Asset2: Instance, Settings: { IgnoredProperties: { string }?, CheckRelativePosition: bool?, Tolerance: double? }?)

    Compares the structural equality of two instances with optional settings, IgnoredSettings is an array of properties that will be ignored during comparison and CheckRelativePosition will compare the position and orientation of parts relative to their parents and Tolerance will be used as the relative position tolerance instead of the default 1e-5 tolerance.

e.g:

local AreEqualSettings = {
    IgnoredProperties = {
        "Parent",
        "CFrame",
        "Rotation"
    },
    CheckRelativePosition = true,
    Tolerance = 1e-3
}

for _, OtherAsset in AssetsStore do
    if InstanceEx.AreEqual(Asset, OtherAsset, AreEqualSettings) then
        IsNew = false
        SavedAsset = OtherAsset
        break
    end
end

I don’t recommend using this in live code, I wrote it to be used with plugins.

5 Likes

It uses a client API dump, still unable to get the hidden properties and functions of LuaWebService, Visit, ThumbnailGenerator and etc that are only available in Roblox’s servers :crying_cat_face::broken_heart: