Problem with the order of costumes

I'm trying to add a virtual keypad to this project, but the next costume block doesn't do what I expected and I don't know why.
Could someone help me?

What I want to do is this:

I expected this result at the moment:

But I get this:

Thanks in advance.

I think this might do what you want

Thanks a lot, Aaron.

How did you no mai name?

It is in the Username= parameter of the link you passed: 1

It doesn't work well to use numbers as the names of costumes. In your project the names and numbers agreed for 1-9 but the zero, costume name 0, was costume number 11, while costume number 0 is of course the turtle.

The usual technique in such cases is to give the costumes names such as digit1, digit2, etc., and then use U5 TTT ITIT-TIF solution file script pic

Thanks, Brian.