1
Modification Help / Clear all bricks
« on: July 09, 2014, 01:35:43 PM »
How do you delete all bricks on a server with a script? This is what I'm currently using:
Only 49-51% of the bricks are deleted every time I execute this, and it causes some bricks to not be cleared properly. What's the correct thing to do?
Code: [Select]
for (%i = 0; %i < MainBrickGroup.getCount(); %i++)
{
%group = MainBrickGroup.getObject(%i);
for (%b = 0; %b < %group.getCount(); %b++)
{
%group.getObject(%b).delete();
}
}
Only 49-51% of the bricks are deleted every time I execute this, and it causes some bricks to not be cleared properly. What's the correct thing to do?