Find detached instances (in registry, off the DataModel)
find-detached-instancesScan the executor's instance registry to report objects detached from the running game, including Destroy()'d or nil-reparented instances, and filter results by ClassName.
Instructions
Walk every instance the executor can see (getinstances) and report the ones that are DETACHED from the running game — i.e. they exist in the executor's instance registry but pcall(inst.IsDescendantOf, inst, game) returns false, so they are not reachable from the DataModel. This catches objects that were Destroy()'d or reparented to nil yet kept alive by a lingering reference, plus anything an anti-detection script has stashed off the hierarchy. An optional className filter narrows the walk to a single ClassName (matched via IsA so subclasses are included). Unlike find-hidden-instances (which uses an ancestor-walk to test reachability), this tool uses IsDescendantOf against game directly, supports a class filter, and always reports a full byClass breakdown across ALL detached instances. Returns { totalDetached, byClass, truncated, samples: [{ class, name }] }. Requires getinstances; degrades with a clear error otherwise. Signature: { className: string?, limit: any?, maxScan: any?, threadContext: number? }. Phase: observe; cost=medium; idempotency=read-only. Requires: active-client. Produces: bounded-candidates. Safety: read-only. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max number of detailed sample instances to return in the samples list (default 200, clamped to 2000). The totalDetached count and byClass tally always cover every detached instance found regardless of this limit. | |
| maxScan | No | Max number of instances to examine from getinstances() before stopping (default 60000, clamped to 500000). Protects against huge games; if hit, `truncated` is set true. | |
| className | No | Optional ClassName to filter to, e.g. 'RemoteEvent', 'LocalScript', 'ScreenGui', 'Part'. Matched with inst:IsA(className) so subclasses are included. Omit to report detached instances of every class. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |