Author Topic: How does this code work?  (Read 398 times)

So I've been wondering  I've seen this topic and im wondering how does it place the baseplate and the bricks?

http://forum.blockland.us/index.php?topic=116178.0

Code: [Select]
%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>");
}
That just prevent people from placing other bricks, without a baseplate, but what I dont get is that how does it make you place bricks on the baseplate, without making you forcefully place another baseplate on top of that

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

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
Oh, Ty lol