Returns the Instances Roblox is holding alive that are not currently parented in the game hierarchy.
These are usually Instances a script created with Instance.new and never gave a parent, or Instances the game detached from workspace but a reference is still holding onto.
Every Instance getnilinstances returns is also in getinstances()’s result - getnilinstances is the floating-in-memory slice of the same set.
Returns
{Instance} - an array of Instances with no spot in the game hierarchy. Order is not guaranteed.
Example
A client anti-cheat may unparent itself to stay out of game traversal. getnilinstances still returns it, so you can walk the list and inspect every detached Instance:
Useful for finding garbage collected objects or scripts stored in nil.