My goal is to end up with a basic text/dialog system where the player walks up to a character/object, hits a button, and a few lines of text display. To handle this I created a "CharacterSpeech" function that, on execution:
1. limits player input (so they can hit button to continue, but aren't running around the screen while the text displays)
2. turns a GUI Textbox visible
3. changes the text to the string parameter passed to the function
4. waits (wait until signal, specifically) until a button is pressed
5. turns textbox invisible
6. returns player control
To test it I had a character call the function upon interaction, to which it promptly said "Hello World!" as expected. However, I want it to say multiple things. I had thought it would have been enough to have two seperate events called upon interaction, both calling the CharacterSpeech function, saying "Hello World" and then "Hello Again," and had assumed that the second function wouldn't be called until the first function completed. This was not the case, and it seems both functions were called simultaneously (which is to say only "Hello Again" appears, having overwritten "Hello World" in the textbox).
How do I set it up so the second "CharacterSpeech" function called in the interaction event doesn't display until after the preceding function is completed?