And the premis being, when you talk to them, it’ll say everything in [1], until you complete a set task. If you keep talking to them it’ll just keep repeating this until you have completed the task. My question is how could I go about efficiently passing this on?
I fire this when the dialogue is opened
function DialogueControl.speakingTo(character)
NPC = character
for _, v in pairs(Text[NPC]) do
print(v)
end
end
With NPC being ‘Guy’ and thus going through his loops. But I’m not sure how I would go about moving this on once a task has been complete
Maybe you could save the progress somewhere (e.g. a variable named currentTask which would store a numerical value), then use some if statements. Something like if currentTask == 1 then ...
To prevent cheating, RemoteFunctions should be used. For example, when the player clicks on some button that starts the dialog, the client sends a request to the server. The server would grab the NPC name, check the player’s progress, and then return the corresponding dialog list. Or maybe it could return the progress and then the client could load up some locally stored text.
The Roblox Dialogue Editor actually allows you to handle this case very well. You can change the initial prompt a user gets based on a certain condition and control how the dialogue flows. Unfortunately, even though it was set to replace the trashy old C++ dialogue system and stand beside custom dialogue systems, it’s not maintained.