API:Class/Debris

Filtered-inheritance mode: While this class technically inherits all Instance class members, some (if not all) have been hidden because they serve no purpose for this object.
Service: This class is a service. It is a top-level singleton which can be obtained with the GetService method.

Debris icon.pngDebris : Object Icon.pngInstance

The Debris service allows you to schedule the removal of an object without yielding any code, through the usage of the AddItem method.

Properties

PropertiesmemberhiddenProperties [toggle]

intMaxItems [deprecated]

Deprecated. Do not use.

|RMD member="API:Class/Debris/MaxItems"|Deprecated. Do not use.|/RMD|
MaxItems [deprecated]
Deprecated. Do not use.

Functions

FunctionsmemberhiddenFunctions [toggle]

voidAddItem ( Instance item, double lifetime = 10 )

Registers an object to the Debris service for removal after the specified delay.

|RMD member="API:Class/Debris/AddItem"|Registers an object to the Debris service for removal after the specified delay.|/RMD|
voidSetLegacyMaxItems ( bool enabled ) [LocalUserSecurity]

Control whether or not the MaxItems property should use a legacy method or not.

|RMD member="API:Class/Debris/SetLegacyMaxItems"|Control whether or not the MaxItems property should use a legacy method or not.|/RMD|
voidaddItem ( Instance item, double lifetime = 10 ) [deprecated]

Deprecated in favor of AddItem.

|RMD member="API:Class/Debris/addItem"|Deprecated in favor of AddItem.|/RMD|
AddItem ( Instance item, double lifetime = 10 )
Registers an object to the Debris service for removal after the specified delay.
SetLegacyMaxItems ( bool enabled ) [LocalUserSecurity]
Control whether or not the MaxItems property should use a legacy method or not.
addItem ( Instance item, double lifetime = 10 ) [deprecated]
Deprecated in favor of AddItem.


|RMD member="API:Class/Debris"|The Debris service allows you to schedule the removal of an object without yielding any code, through the usage of the AddItem method. |/RMD|


Notes

  • The Debris service will remove the object in the same manner the Destroy method does.
  • If AddItem is called from a LocalScript and the player who made the call leaves the game before the item is removed, it will not be removed.