Hello developers.
I’m trying to make a NPC, like work at a pizza place where a customer walks up to the counter and a Dialog comes up above their head Saying something like “Hello”, then the player responds with 3 options, one option being correct. Then the player presses the button with a picture of the item they asked for (like a coffee button) if they asked for coffee. I’ve struggled to do this for the past hour and a half. This is the only script I have so far, I really need help on this project. Any advice or help is appreciated, thanks .
local options = {"Hi what can I get for you today?", "Go away!", "You suck!"
}
while wait(1) do
script.Parent.WalkToPoint = script.Parent.Parent.Parent.PointB.Position
wait(.1)
local p = script.Parent.Parent.Head.Dialog.DialogChoice
local p1 = script.Parent.Parent.Head.Dialog.DialogChoice1
local p2 = script.Parent.Parent.Head.Dialog.DialogChoice2
p.UserDialog = options[math.random(1, #options)]
p.ResponseDialog = choices[math.random(1, #choices)]
p1.ResponseDialog = choices[math.random(1, #choices)]
p2.ResponseDialog = choices[math.random(1, #choices)]
end
script.Parent.WalkToPoint = script.Parent.Parent.Parent.PointA.Position