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 andCheckRelativePosition
will compare the position and orientation of parts relative to their parents andTolerance
will be used as the relative position tolerance instead of the default1e-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.