Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.