Extend
Creates a child Vault that will be automatically cleaned when the parent is cleaned.
- TypeScript
- Luau
const parent = new Vault("Parent")
const child = parent.Extend("Child")
child.Add(new Instance("Part"))
parent.Clean()
local parent = Vault.new("Parent")
local child = parent:Extend("Child")
child:Add(Instance.new("Part"))
parent:Clean()
Parameters
| Parameter | Type | Description |
|---|---|---|
name? | string | Optional name for the child vault |
Returns
Descriptor - The newly created child vault
Behavior
- Creates a new vault instance as a child of the current vault
- Child is automatically cleaned when parent is cleaned
- Enables hierarchical cleanup structures
- Child vaults can have their own children