Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What is fakeDebris and what does this script use the variable for?

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

I keep looking in uncopylocked games to see if I understand their scripts. And this script keeps appearing in them:

local fakeDebris = {}
    fakeDebris.AddItem = (function(Object,Time)
        coroutine.resume(coroutine.create(function()
            wait(Time)
            Object:Destroy()
        end))
    end)
return fakeDebris

I have no idea what this script is and I cannot find any information from other users. I have asked friends and asked people on the Roblox Forums. Still nobody can answer this for me.

Please help.

1 answer

Log in to vote
1
Answered by
Pyrondon 2089 Game Jam Winner Moderation Voter Community Moderator
8 years ago

This script is basically a recreation of Debris. Debris:AddItem(i, t) is a method which destroys instance 'i' after time 't' in seconds have passed.

The script may have been created to bypass the limitation of Debris that it doesn't delete an item if called from a localscript if the player leaves. I'd assume this is a ModuleScript created for that sole purpose.

Hope this helped.

Ad

Answer this question