made this extension, hope it helps.
(copy it into a text file and import it as an extension)
{ "author": "", "category": "", "extensionNamespace": "", "fullName": "animation number", "helpPath": "", "iconUrl": "", "name": "GetAnimationNumber", "previewIconUrl": "", "shortDescription": "animation number", "version": "1.0.0", "description": "animation number", "tags": [], "authorIds": [], "dependencies": [], "eventsFunctions": [ { "description": "checks how many animations does an object have", "fullName": "object animation count", "functionType": "Expression", "name": "animation_count", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { "value": "ModVarObjet" }, "parameters": [ "object", "old_animation", "=", "object.Animation()" ] } ] }, { "type": "BuiltinCommonInstructions::Repeat", "repeatExpression": "99", "conditions": [], "actions": [ { "type": { "value": "ChangeAnimation" }, "parameters": [ "object", "+", "1" ] } ] }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { "value": "SetReturnNumber" }, "parameters": [ "object.Animation()" ] } ] }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { "value": "ChangeAnimation" }, "parameters": [ "object", "=", "object.Variable(old_animation)" ] } ] } ], "expressionType": { "type": "expression" }, "parameters": [ { "description": "sprite object to check for.", "name": "object", "supplementaryInformation": "Sprite", "type": "objectList" } ], "objectGroups": [] } ], "eventsBasedBehaviors": [], "eventsBasedObjects": [] }