Skip to main content

Remove

Removes a resource from the Vault without cleaning it. Returns true if the resource was successfully removed, false otherwise.

The method accepts either the original object or its token identifier.

const part = new Instance("Part")
part.Parent = workspace

vault.Add(part)

const removed = vault.Remove(part)
print(`Part removed: ${removed}`)

const connection = part.Touched.Connect(() => {
print("Touched")
})

const token = vault.Add(connection)
const removedByToken = vault.Remove(token)
print(`Connection removed: ${removedByToken}`)

const nonExistent = vault.Remove(123456)

Notes

Unlike Clean(), this method removes the resource without cleaning the entire vault, allowing individual resources to be managed separately.