Arduino coin counter [Solved]

Hello everyone, I have just finished making the physical part of a coin counter machine (very crude, out of cardboard and silicone, and yes, very ugly) but I am a little stuck on the coding part.
I am using an optocoupler from an old printer and I've gotten it to display the number in the serial terminal, and also beep when a coin is successfully "seen" and make a set of beeps when it reaches a multiple of ten.
Now I am trying to make it do 'n' sets of three beeps, to tell you the number, as it doesn't have a display, and I'm trying to use interrupts, which I am new to (I know it sounds stupid, because you will have to wait for it to stop beeping after you've pressed the button, but maybe you can help me make it only read the ones of the number, and leave the tens and/or hundreds alone).

Here is my code so far (only the interrupt part isn't working):

#define oc analogRead(A0)
int yep = 0;
volatile int number = 0;
volatile int i = 1;
#define treshold 500
int abc;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(2, INPUT);
  attachInterrupt(0, beepNumber, FALLING);
}

void loop() {
  // put your main code here, to run repeatedly:
  if (yep == 0) {
    if (oc > treshold) {
      number = number + 1;
      yep = 1;
      Serial.println(number);
      abc = number % 10;
     tone(3, 6000);
     delay(100);
     noTone(3);
     if (abc == 0) {
      tone(3, 5000);
      delay(50);
      noTone(3);
      delay(50);
      tone(3, 5000);
      delay(50);
      noTone(3);
      delay(50);
      tone(3, 5000);
      delay(50);
      noTone(3);
      delay(50);
      noTone(3);
      
     }
    }
  }
  if (oc < treshold) {
    yep = 0;
  }
}

void beepNumber() {
  for(i = 1; i<=number;i++) {
    tone(3, 6000);
    delay(50);
    noTone(3);
  }
  delay(500);
}

Any help is much appreciated, I know there are some mistakes.

Please?

I only need help on the interrupt part, so, once I press the button, it does a series of beeps, dependent on the number of coins counted. That's the only part that doesn't work

Interrupts are supposed to do as little as possible, just set a flag usually. Certainly not anything involving Tone or delay. Move that stuff elsewhere and trigger it with a volatile flag that the interrupt sets.