search/
Start typing to search packages!
package_2
create-scope
By @sap0bombado
Roblox
Mirroredcreate-scope
Resource cleanup. Track Instances, connections, threads, and functions, clean them all at once by calling scope().
Install
[dependencies]
createScope = "sap0bombado/create-scope@0.3.1"
API
createScope(size?, ...) -> (Scope, T...)
| Param | Type | Description |
|---|---|---|
size | number? | Initial capacity |
... | T... | Initial items to track (returned as extra values) |
Scope
Callable: scope(item) -> item tracks an item; scope() cleans up all items.
Cleans items by type: Instance (:Destroy), RBXScriptConnection (:Disconnect), function (call it), thread (task.cancel), table (tries common cleanup methods like :Destroy, :Disconnect, etc.).
Example
local scope = createScope()
local part = scope(Instance.new("Part"))
part.Parent = workspace
local conn = scope(RunService.Heartbeat:Connect(function(dt)
print("Heartbeat", dt)
end))
scope(function()
print("Custom cleanup")
end)
-- Clean everything
scope()
Package Details
Install command (Click to copy)
Version
0.3.1
License
MIT
Safe for commercial use
Automated license review — not legal advice.
