So, I am working on a story game with objectives that you must complete to proceed.
There is a textlabel that displays what your current objective is. It gets updated after every dialouge segment.
Example – SomeGuy : “Alright folks go explore the new house while I prepare dinner” (bad dialouge ik)
So once the dialogue is said, the task label shows : “Task- explore house”
The way I did this was that I put a string value in game.Workspace, and after the dialouge is said from the script, it updates the string value’s value to “Task- explore house”.
Then it fires an event that checks the value and then puts it in textlabel.text = game.Workspace.value.value
depending on whether your script is server sided or not, that could override other players objectives. but if it is local, there shouldn’t be a problem. there are infinite amounts of ways you can do some specific piece of code.
the way that i’d do it is by placing that stringvalue into a folder where the players other values should be. since you’re probably saving your objectives I don’t think using a stringvalue is inefficient in the slightest, a lot of games use value instances for saving (stringvalues, boolvalues, number/intvalues).
If the story is linear, you can opt for a dictionary. This dictionary will contain the “speaker” and the “message”. The game will execute each of the lines and then after it finishes, go to the next. You can also optionally add some special rules between, like delay, that you can add in case of non-verbal events. For objectives, you will try to use signals to wait for the objectives to complete themselves(i.e. out of time) or by the players.