# Debris

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Tags: Not creatable, Service
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/Debris/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/Debris

Allows scheduling the guaranteed destruction of an object without yielding.

## Properties

### MaxItems

```luau
Debris.MaxItems: number
```

- Tags: Deprecated, Read capabilities: Basic

**Deprecated:** This property is deprecated and should not be used in new work.

The maximum number of items that can be assigned to the [`Debris`](https://rapi.sleaze.dev/classes/Debris.md) service at one time.

## Methods

### AddItem

```luau
Debris:AddItem(item: Instance, lifetime: number? = 10)
```

- Tags: Capabilities: Basic

Schedules a given [`Instance`](https://rapi.sleaze.dev/classes/Instance.md) for destruction within the specified lifetime.

Parameters:

- `item`: The [`Instance`](https://rapi.sleaze.dev/classes/Instance.md) to add to [`Debris`](https://rapi.sleaze.dev/classes/Debris.md).
- `lifetime`: Number of seconds before the [`Instance`](https://rapi.sleaze.dev/classes/Instance.md) should be destroyed.

### SetLegacyMaxItems

```luau
Debris:SetLegacyMaxItems(enabled: boolean)
```

- Tags: Local user security, Capabilities: Basic

### addItem

```luau
Debris:addItem(item: Instance, lifetime: number? = 10)
```

- Tags: Deprecated, Capabilities: Basic

**Deprecated:** This function is a deprecated variant of [`Debris:AddItem()`](https://rapi.sleaze.dev/classes/Debris.md) which should be used instead.

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
