A Hat block is a block that is designed to start a script. There are four Hat blocks, and they can be found in the Control category.
As Hat blocks are designed to start a script, they are shaped so no blocks can go on top of them - this is done by rounding the top of the block. They have a bump on the bottom - this is so blocks can be placed under them.
Without Hat blocks, scripts can only manually activate. Each Hat block has a different method for getting activated - this is so different scripts can be started at different times. There are four different ways to activate a script - when the flag is clicked, a key is pressed, the sprite is clicked, or when a broadcast is received.
An example for when the When I Receive () block can be used follows: