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.
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 ><
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