getreferencedby Synchronous

  • getreferences

Find known Instances that have a readable property referring directly to a target Instance. Use it to locate an obvious owner or link when a reference is stored in properties.

Syntax
Luau
getreferencedby(target: Instance) -> {Instance}

Parameters

Function parameters
ParameterTypeDescription
targetInstanceInstance to search for in other Instances’ readable properties.

Returns

{Instance}

An array of Instances with at least one property equal to the target.

Usage notes

The wrapper scans getinstances and getproperties, so unavailable properties and references stored only in tables or closures are not included.

Example

Example
Luau
local part = Instance.new("Part")
local selection = Instance.new("ObjectValue")
selection.Value = part
local owners = getreferencedby(part)
print("Known objects with a property pointing to part:", #owners)
selection:Destroy()
  part:Destroy()
Kawaii documentation