2DWorlds Forums
ChildAdded bug - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: Bug Reports (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=23)
+--- Thread: ChildAdded bug (/showthread.php?tid=6194)



ChildAdded bug - justgoaway1 - 06-25-2011

function killblock(part)
if (part~=nil) then
if (part.Type == "Box") then
if (part.Name == "Debris") then
sleep(4)
for i=1, 100 do
part.Transparency = i/100
sleep(0.01)
end
part:remove()
end
end
end
end

link(game.World.Stuff.ChildAdded, function(child)
thread = coroutine.create(killblock)
assert(coroutine.resume(thread, child))
end)

~~~~~~~~~~~~~~~~~~~~~~~~~~~

This script is used at my Tunnel Combat game to clear the grey stones that are created after excavating a block. However, it barely works, maybe 1 in 30 of every block created starts to turn a little transparent, then stops.