Okay, tons of things.
1. Nowhere in this code does it actually attempt to do anything to any bricks. It's just a mess trying to read a file.
2.
new scriptObject(LineSO){} - I have no idea what this is supposed to do. LineSO is never referenced anywhere. There's no semicolon after the object declaration so it's going to cause a syntax error.
3. Why the forget do you have two functions outside of the actual function that have no purpose other than deleting script objects?
4. I just realized that the file is called
Client_ColorDestroy. How is this a client mod? What.
I don't even know why you want it to read a file. I have this in some random "Handy Function" package I built.
function deleteAll(%brickType)
{
// Did we supply a valid datablock?
if(isObject(%brickType))
{
%killList = "";
// Loop through all brickgroups.
for(%a = 0; %a < MainBrickGroup.getCount(); %a++)
{
%bg = MainBrickGroup.getObject(%a);
// Loop through every brick in this brickgroup.
for(%b = 0; %b < %bg.getCount(); %b++)
{
%brick = %bg.getObject(%b);
// Test if the bricktype of the selected brick
if(%brick.getDatablock().getID() == %brickType.getID())
{
%killList = setField(%str, getFieldCount(%killList), %brick.getID());
}
}
}
for(%a = 0; %a < getFieldCount(%killList); %a++)
{
%brick = getField(%killList, %a);
%brick.killBrick();
}
echo("Destroyed" SPC getFieldCount(%killList) SPC "Brick(s).");
}
}
Just change it to delete if the color ID matches the ID entered in the parameters.
Someone was trying to do this once.
How could he fail? This is not a complex issue.