%client.undostack.push(%brick TAB "Plant");
This is the easy way, but will cause undo commands to break each brick one at a time.
I wish for the whole minifig brick to get rid of all its body parts upon broken, if possible
also, only the left foot plants now
package MinifigBrick
{
function fxDTSbrick::PlantedTrustCheck(%brick)
{
Parent::PlantedTrustCheck(%brick);
if(%brick.GetDatablock().getName() $= brickMinifigV2Data)
{
%pos = %brick.position;
%rot = %brick.rotation;
%colorID = %brick.colorID;
%owner = %brick.client;
%brick.delete();
%LeftShoe = new fxDTSbrick()
{
datablock = "brickLeftShoeData";
isPlanted = 1;
position = %pos;
rotation = %rot;
colorID = %colorID;
client = %owner;
};
%LeftShoe.setTrusted(1);
%LeftShoe.plant();
if(%owner.brickGroup)
{
%owner.brickGroup.add(%LeftShoe);
}
return %LeftShoe;
%RightShoe = new fxDTSbrick()
{
datablock = "brickRightShoeData";
isPlanted = 1;
position = %pos;
rotation = %rot;
colorID = %colorID;
client = %owner;
};
%RightShoe.setTrusted(1);
%RightShoe.plant();
if(%owner.brickGroup)
{
%owner.brickGroup.add(%RightShoe);
}
return %RightShoe;
}
}
};
ActivatePackage(MinifigBrick);
I know that a % variable is replaced really easily, so I tried duplicating what the left shoe used and having it plant the right shoe with a different variable for each brick, no luck