Here's a very basic key input example I shared to someone else on our discord server. It's a crude example, but it should probably be enough for what you are wanting to do.thanks! I'll play around with this
function processTxt()
if str.String == "world" then
startAction(Actions["hello_world"]) -- true
elseif str.String == "example text 1" then
startAction(Actions["example1"]) -- true
elseif str.String == "example text 2" then
startAction(Actions["example2"]) -- true
else
startAction(Actions["invalid_input"]) -- false
end
end
local t_answers = {
{ans = "world", act = "hello_world"},
{ans = "some text 1", act = "example1"},
{ans = "some text 2", act = "example2"},
{ans = "some text 3", act = "example3"},
{ans = "some text 4", act = "example4"},
{ans = "some text 5", act = "example5"}
}
function processTxt()
for i = 1, #t_answers do
if str.String == t_answers[i].ans then
startAction(Actions[t_answers[i].act])
break
end
-- + --
if i == #t_answers and str.String ~= t_answers[#t_answers].ans then
startAction(Actions["invalid_input"])
end
end
end