Thats alright, it’s late for me too.
local plrs = game:GetService('Players')
local lp = plrs.LocalPlayer
local ChatBox = script.Parent
local replicatedstorage = game:GetService('ReplicatedStorage')
local ManageFrame = script.Parent.Parent
local msgcloner = script.Parent.Parent.MsgCloner
tbl1 = nil
tbl2 = nil
tbl3 = nil
local UIS = game:GetService('UserInputService')
local tweenservice = game:GetService('TweenService')
Greetings = {
"Hello",
"Hi",
"hello",
"hi",
"Hola",
"hola",
"yo",
"Yo",
"Hi!",
"hi",
"Howdy",
"howdy",
"Greetings",
"greetings",
"hey",
"Hey",
"Good Day",
"G'day",
"good day",
"g'day",
"Gday",
"gday",
"Good day",
"Good morning",
"good morning",
"Good Morning",
"Good mornin",
}
MoodStateQues = {
"Hru",
"hru",
"how are you",
"How are you",
"HOWAREYOU",
"Mood Check",
"mood check",
"Hows it",
"How's it",
"hows it",
"how's it",
"how is it",
"What's up",
"whats up",
"Whats up",
"WHATS UP",
"WSP",
"wsp",
"Wsp",
"How's your day",
"How is your day",
"how's your day",
"how is your day",
"How are you lately",
"how are you lately",
"How you been",
"how you been",
"How have you been doing",
"how have you been doing",
}
MoodStateResp = {
"I'm good",
"Im good",
"I am good",
"Pretty good thanks",
"pretty good thanks",
"pretty snazzy",
"im great!",
"Feeling good",
"feelin' good",
"lmao good thanks",
}
troll = {
"cheese grater",
"amogus",
}
trollresp = {
"same",
"I agree",
"fard?"
}
--International English Base Word Directory--
local function createchat(origin, text)
for _, v in pairs(msgcloner:GetChildren()) do
local msgpieces = v:Clone()
local msgbase = msgcloner:Clone()
wait()
msgbase.Parent = ManageFrame
msgpieces.Parent = msgbase
msgbase.BackgroundTransparency = 0.2
msgbase.TextTransparency = 0
msgbase.Name = "ChatClone"
if origin == "ai" then
for _, v in pairs(ManageFrame:GetChildren('ChatClone')) do
if v:IsA('TextLabel') then
v.Position = v.Position - UDim2.new(0,0,0.15,0)
end
end
msgbase.Position = UDim2.new(0.028, 0, 0.692, 0)
msgbase.Text = text
ChatBox.Text = ""
else
for _, v in pairs(ManageFrame:GetChildren('ChatClone')) do
if v:IsA('TextLabel') then
v.Position = v.Position - UDim2.new(0,0,0.15,0)
end
end
msgbase.Position = UDim2.new(0.653, 0, 0.692, 0)
msgbase.Text = text
ChatBox.Text = ""
end
end
end
local function searchlistai(text)
for _, v in pairs(Greetings) do
if string.find(v, text) then
print('yes')
createchat('ai', Greetings[math.random(1,#Greetings)])
end
end
----------------------------------------------------------
for _, v in pairs(MoodStateQues) do
if string.find(v, text) == true then
print('yes')
createchat('ai', MoodStateResp[math.random(1,#MoodStateResp)])
end
end
----------------------------------------------------------
for _, v in pairs(troll) do
if string.find(v, text) then
print('yes')
createchat('ai', trollresp[math.random(1,#trollresp)])
end
end
end
local function onFocusLost(enterPressed)
if enterPressed then
createchat('plr', ChatBox.Text)
searchlistai(ChatBox.Text)
end
end
ChatBox.FocusLost:Connect(onFocusLost)