Trying to make an NPC like..
Hello everyone I'm trying to make an NPC like system that talks to the player when the player press a key, I sort of know how to make a pop-up text appear when a key is pressed, but I want to make it like a dialog like so the NPC is like talking to the player to give a quest or information.
var textIsShowing:Boolean = false;
var buttonPressedOnce = false;
if(talkKeyDown == true){
if (textIsShowing == false && buttonPressedOnce== false){
if(charMC.hitTestObject(back.other.doorLvl)){
doorNote.text = "Door is locked!";
textIsShowing = true;
}
} else if (textIsShowing==true && buttonPressedOnce==true) {
doorNote.text = "";
textIsShowing = false;
}
} else {
if (textIsShowing == true && buttonPressedOnce== false ){
buttonPressedOnce = true;
} else if (textIsShowing == false && buttonPressedOnce == true){
buttonPressedOnce = false;
}
}
How can I put another text message when I press the same key, I'm trying to have an NPC like so when the character talks to the npc it shows a dialog text.
Press key "then shows the first line of text"
Press again "shows another text" ....
until it disappear/closes when the dialog has finished.
