getnilinstances
Returns all instances with nil parent.
Syntax
getnilinstances() -> tableReturns
| Type | Description |
|---|---|
table | Array of nil-parented instances |
Description
getnilinstances returns all instances that have their Parent set to nil. These instances exist in memory but aren't part of the game hierarchy.
Example
local nilInstances = getnilinstances()
print("Nil instances:", #nilInstances)
for _, inst in ipairs(nilInstances) do
print(inst.ClassName, inst.Name)
endFinding Hidden Scripts
-- Scripts are sometimes hidden by setting parent to nil
local hiddenScripts = {}
for _, inst in ipairs(getnilinstances()) do
if inst:IsA("LocalScript") or inst:IsA("ModuleScript") then
table.insert(hiddenScripts, inst)
end
end
print("Found", #hiddenScripts, "hidden scripts")Use Cases
- Finding hidden instances: Locate instances games try to hide
- Script discovery: Find scripts that were parented to nil
- Memory inspection: See what's being kept in memory
Related Functions
getinstances- Get all instances