For bots.
And players
I not understand what you try say ? do you mind post here script.
There is no setShapeName method for bricks, so the way your doing this will never work.
You need to create the function, and have it create a StaticShape, set its position to where the brick is, and then setShapeName on the static shape.
You'll also need to do some other things, like create a variable with the value as the StaticShape, so you can reference it in functions like setShapeNameColor and setShapeNameDistance. You also need to parent onDeath/onRemove so that the StaticShape is deleted when the brick is deleted.