Hello! I hope you’re doing well 
The way you organized the interactions and the interaction handler wasn’t the best because it’s harder to maintain, and it can easily get unorganized. I thought on this approach, take a look:
Interactions (ModuleScript) - Here is where we can keep all the interactions organized
local Interactions = {
{
Matches = { 'hi', 'hello', 'hey' },
Responses = {
"Whats up my dude";
"Hey";
"Yooo";
"Greetings, friend.";
"Hi";
"Hewoooooooo";
},
},
{
Matches = { 'bye' },
Responses = {
"Noo don't leave me!!";
"Bye!";
"See you soon!";
"i get lonely, you don't want to leave me do you?";
"just press F4 already";
},
},
{
Matches = { 'thanks', 'tysm' },
Responses = {
"Oh did I do something?";
"Your welcome!";
"You are being really sincere today :)";
"No problem!";
":D";
},
},
{
Matches = { 'i hate you' },
Responses = {
"Why are you here??";
"Please go away!";
"Moveee!";
},
},
}
return Interactions
As you can see, each context is separated (“hi”, “bye”, “thanks” etc), creating an array. The Matches
table stores the trigger words, if the player chats any word inside it, a random response will be sent back. The Responses
table stores the possible responses, which will be randomly chosen later.
Now that we’ve understood how our interactions data is stored, let’s move on to the main script:
This is the way I parented the scripts, you can do it as you prefer.

MainScript (Script) - Here is where we put things together
local Interactions = require(script.Interactions)
local function GetResponseForInteraction(interaction: string): string
-- Going through each interaction
for _, interaction_information in ipairs(Interactions) do
-- Looking for all the matches to see if we find a trigger word
for _, match in ipairs(interaction_information.Matches) do
-- Does the interaction match?
if (interaction:lower():match(match)) then
-- Choosing a response and returning it
local responses = interaction_information.Responses
local random_response = responses[math.random(#responses)]
return random_response
end
end
end
-- If no matches have been triggered, we return this message
return "Ops! I can't understand it yet."
end
-- Variables
local Players = game:GetService('Players')
local NoraNPCModel = workspace:WaitForChild("Nora")
local Head = NoraNPCModel:WaitForChild("Head")
local Chat = game:GetService("Chat")
Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
local response = GetResponseForInteraction(message)
Chat:Chat(Head, response)
end)
end)
I hope it helps! This is only one of many possible ways you can think to organize everything and keep it consistent. Good luck with your project! 