Skip to content

Debris

Summary

Syntax

Debris:AddItem(instance: Instance, lifetime: number): ()

Overview

Debris is a service that allows removal of instances without yielding for objects that may lose utility after a set period of time.

local Debris = game:GetService("Debris")
local part = Instance.new("Part")
part.Parent = workspace
Debris:AddItem(part, 5)

Lifetime

The AddItem() method won’t execute unless a lifetime parameter is given.

The lifetime can be set to any number from positive to negative range.