%plantedBrick = %client.brickGroup.getObject(%client.brickGroup.getCount() - 1); if(%plantedBrick.getDistanceFromGround() == 0 && %plantedBrick.getDatablock().category !$= "Baseplates") { %plantedBrick.delete(); commandToClient(%client,'MessageBoxOK',"Invalid Brick","You must start with a Baseplate.<bitmap:base/client/ui/brickIcons/16x16 Base>"); }
Checks if the bricks distance to the ground is 0 (aka it's on the ground), if it is, and the brick ain't a baseplate, it deletes it