Skip to content

Instantly share code, notes, and snippets.

local string_gmatch = string.gmatch
local function getWordDashSpaceTable(txt, tbl)
local tbl, numTbl = tbl or {}, 0
for word1, dash, word2, space in string_gmatch(txt, "([^%-%s]*)(%-)(%S*)(%s*)") do
tbl[numTbl + 1] = word1
tbl[numTbl + 2] = dash
tbl[numTbl + 3] = word2
tbl[numTbl + 4] = space
numTbl = numTbl + 4
end
local instanceDestroyed = require(script.Parent.MainModule)
do
local a = Instance.new("Part")
instanceDestroyed(a, function()
print("Test 1 destroyed")
end)
a:Destroy()
end
--[[
Version 4:
Fixed garbage collection detection.
Edit 3:
Clarified/fixed some terminology. (comments only)
Version 2:
Made it not prevent garbage collection by using ObjectValues
Version 1:
Initial
local mode = 0 -- 0 is ClassName, 1 is Name, 2 is parent, 3 is FullName
local printRate = 60 -- set to math.huge to disable
-- You can add a BindableEvent named PrintStats to this script and fire it to print stats
---
local changes = {}
local GetFullName = workspace.GetFullName
game.ItemChanged:connect(function(item, prop)