i have a custom chat gui script for a phone
this is the code that controls what displays in the message boxes
Tool.Words.Changed:connect(function()
if (Tool.Words.Value == "*Dial Tone*") then
print("DialTonetext RECOGNIZED")
return
elseif (Tool.Words.Value ~= "") then
lastphrase = Tool.Words.Value
if lastphrase == "*Dial Tone*" then
msgs.MSG1.Text = "*Dial Tone*"
return else
local filtered
local success, errorMsg = pcall(function()
filtered = chat:FilterStringAsync(lastphrase, player, player)
end)
if filtered and success then
if (msgs:findFirstChild("MSG5") ~= nil) then
for i = 5, 2, -1 do
local num1 = i
local num2 = i - 1
msgs:findFirstChild("MSG" ..num1).Text = msgs:findFirstChild("MSG" ..num2).Text
end
msgs.MSG1.Text = filtered
else
msgs.MSG1.Text = errorMsg
end
end
wait(0.1)
Tool.Words.Value = ""
end
end
end)
end
the code pretty much changes a StringValue to the player’s most recent chat which will then be displayed in the GUI
anyways
i want to make it if the text “Dial Tone” is the most recent chat it will skip the rest of the code. is this possible?