Maid
The Maid class lets you easily watch and clean up objects, events, and other tasks. Written by Quenty, this class has proven itself worthy in some of Roblox's most successful games.
Constructor¶
Maid.new()
¶
Creates a new Maid instance.
1 |
|
Methods¶
GiveTask(task)
¶
Stores a task. The task can be an event connection, an instance or table with a Destroy
method, or a function. When the maid's DoCleaning
or Destroy
method is invoked, these tasks will be cleaned up. Events will be disconnected, instances will be destroyed, and functions will be called.
1 2 3 |
|
Returns: number
index of the task.
GivePromise(promise)
¶
Stores a promise. If the maid is cleaned up and the promise is not completed, the promise will be cancelled.
1 2 3 4 |
|
Returns: Promise
DoCleaning()
¶
Cleans up all the tasks. Event connections will be disconnected, instances will be destroyed, and functions will be called.
1 |
|
Destroy()
¶
Alias for DoCleaning
.
1 |
|