My function is called several times,Text is called several times

i used a script to make the dialogue and another script to call the text with a triggerenter2d so when the player hit the collider it triggers the function, but is called a lot of times.

(script of the text)

 using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using TMPro;
    using UnityEngine.UI;
    
    
    public class Dialogueinfo : MonoBehaviour
    {
    
        public TextMeshProUGUI textDisplay;
        [TextArea(3, 10)]
        public string[] sentences;
        private int index;
        public float typingSpeed;
        public GameObject continueButton;
        public Animator textDisplayAnim;
        
        
        
        public void once()
        {
           StartCoroutine(Type());
             
        }
    
        void Update() 
        {
        
            if(textDisplay.text == sentences[index])   
            {
                continueButton.SetActive(true);
            }
        }
    
        IEnumerator Type()
        {
            foreach (char letter in sentences[index].ToCharArray())
            {
                textDisplay.text += letter;
                yield return new WaitForSeconds(0.0f);
            }
        }
    
        public void NextSentence(){
    
            textDisplayAnim.SetTrigger("Change");
            continueButton.SetActive(false);
        
            if(index < sentences.Length - 1)
            {
                index++;
                textDisplay.text = "";
                StartCoroutine(Type());
            } else {
                textDisplay.text = "";
                continueButton.SetActive(false);
                
            }
        }
        
    }

(Script of the trigger)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Dialogueshoot : MonoBehaviour
{
    private void OnTriggerEnter2D(Collider2D other) 
    {
        if(other.CompareTag("Player"))
        {
            FindObjectOfType<Dialogueinfo>().once();
            
        }
    }
}

see if changing if(other.CompareTag(“Player”)) from the trigger script into :if(other.name(“Player”)).might work