Skip to content

Instantly share code, notes, and snippets.

@Corecii
Last active August 18, 2016 19:35
Show Gist options
  • Save Corecii/70bd5c0dd8ce6d96fe0ba941a3908a3c to your computer and use it in GitHub Desktop.
Save Corecii/70bd5c0dd8ce6d96fe0ba941a3908a3c to your computer and use it in GitHub Desktop.
local instanceDestroyed = require(script.Parent.MainModule)
do
local a = Instance.new("Part")
instanceDestroyed(a, function()
print("Test 1 destroyed")
end)
a:Destroy()
end
do
local a = Instance.new("Part")
instanceDestroyed(a, function()
print("Test 2 destroyed")
end)
a.Parent = workspace
a:Destroy()
end
do
local a = Instance.new("Part")
instanceDestroyed(a, function()
print("Test 3 destroyed")
end)
a.Parent = workspace
a.Parent = nil
a:Destroy()
end
do
local a = Instance.new("Part")
instanceDestroyed(a, function()
print("Test 4 destroyed")
end)
a.Parent = workspace
a.Parent = nil
wait(0.1)
a:Destroy()
end
do
local a = Instance.new("Part")
instanceDestroyed(a, function()
print("Test 5 destroyed")
end)
wait(0.1)
a:Destroy()
end
do
local a = Instance.new("Part")
local b = instanceDestroyed(a, function()
print("Test 6 destroyed")
end)
a.Parent = workspace
a:Destroy()
b:disconnect()
end
do
local a = Instance.new("Part")
local b = instanceDestroyed(a, function()
print("Test 7 destroyed")
end)
b:disconnect()
a:Destroy()
end
do
local a = Instance.new("Part")
local b = instanceDestroyed(a, function()
print("Test 8 destroyed")
end)
a = nil
end
do
local a = Instance.new("Part")
local b = instanceDestroyed(a, function()
print("Test 9 destroyed")
end)
while wait() do
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment