How do I change text entities in code

Hello, I am wondering how I can make a code that If I hit the h key the text entity will say something different.

let t = false;
if(this.app.keyboard.isPressed(pc.KEY_H)){
if(t == false){
//change text 
t = true
}
if(t == true){
//change text 
t = false
}
}

Hi @Codeknight999!

Assuming you use an element component, it will be something like below.

this.entity.element.text = 'Your new text';