# Clear text?

**URL:** <https://forum.kirupa.com/t/clear-text/216153>\
**Category:** programming\
**Created:** [February 14, 2007, 3:28am UTC](https://forum.kirupa.com/t/clear-text/216153 "2007-02-14T03:28:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hansol](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@Hansol](https://forum.kirupa.com/u/Hansol)\
**Post date:** [February 14, 2007, 3:28am UTC](https://forum.kirupa.com/t/clear-text/216153/1 "2007-02-14T03:28:46Z")

</div>

im trying to create a npc so when the charater goes over and presses shift the text shows up in the text box, it works and when i tell it to clear when it goes over it clears it also, but it keeps it clear so you cannot talk to another npc heres the code… so basically i dont know how to clear the text without clearing it completely just making it equal nothing for the moment until i talk to another npc. this is how many code is right now its only playing the second player on enter frame dunno why and when i put it both on one… weird stuff happens.

```auto
player.onEnterFrame = function() {
    if (this.hitTest(map.joe) & Key.isDown(Key.SHIFT)) {
        gametext = "Hi, please continue down the road to town!";
    } else if (!this.hitTest(map.joe)) {
        gametext = "";
    }
    
};
player.onEnterFrame = function() {
    if (this.hitTest(map.jim) & Key.isDown(Key.SHIFT)) {
        gametext = "Hi,I buy and sell potions!";
    } else if (!this.hitTest(map.jim)) {
        gametext = "";
    }
};

```

i just tried something like but then the shift butten must be held down \>\<

```auto

player.onEnterFrame = function() {
    if (this.hitTest(map.joe) & Key.isDown(Key.SHIFT)) {
        gametext = "Hi, please continue down the road to town!";
    } else if (this.hitTest(map.jim) & Key.isDown(Key.SHIFT)) {
        gametext = "Hi,I buy and sell potions!";
    } else {
        gametext = "";
    }
};

```

Thanks 😃
