This is a tutorial on how to make a block that senses how many costumes a sprite has. Click to advance through slides
If you get confused, then click see inside and check the custom block. The comments explain how it works.