So I'm trying to make ordering/cashier system like Work at a Pizza Place. But, I'm stuck. I don't know the dialogue system very well. So, I'm asking for some help on making a NPC's ResponseDialogue being a random choice out of 4 choices, instead of one response dialogue.
✓ ANSWER ACCEPTED
How can I make a NPC's RepsonseDialogue be multiple choice/random awnser?
1 answer
✓ Accepted answer
This creates an initial prompt so that when you click the dialog the prompt's object/character will tell you one of the three in the table.
local Dialog = Instance.new("Dialog")
Dialog.Parent = script.Parent -- script.Parent refers to the object this script is under.
local Prompts = {
[1] = ("Hi!");
[2] = ("Hey!");
[3] = ("What's up!");
};
Dialog.InitialPrompt = Prompts[math.random(1,#Prompts)] -- math.random function picks a random prompt.
This discussion is preserved as it was. New answers, comments, and votes are closed.
