|
| 16 Feb 2014 04:13 PM |
i was wondering how to use the debris?
and how it realy works
|
|
|
| Report Abuse |
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 16 Feb 2014 04:20 PM |
It's just delayed garbage collection.
local debris = Game:GetService("Debris") debris.AddItem(Workspace.adark, 20)
is equivalent to:
wait(20) Workspace.adark:Destroy()
However, when using Debris, you don't get an error if the object doesn't exist when you try to destroy it.
Debris is also useful when you want to remove a script after it runs, since that will sometimes produce an error, but using Debris will simply wait until it can be destroyed. |
|
|
| Report Abuse |
|