It may seem complicated to create one script that can count the amount of costumes in a sprite, but it's really easy! Inside this project, you will find a custom block providing the script, and the process of how I made it. Script is only used 15 blocks and 2 variables
You can use it but please give me credit Everything by @matthew1214