local TableOfContents = {
["local"] = "#f21414"
}
while wait() do
for i, v in pairs(TableOfContents) do
if(string.find(tostring(script.Parent.Text), i)) then
string.gsub(tostring(script.Parent.Text), i, '<font color="'..v..'">'..i.."</font>", 1)
end
end
end
I made it print if it equals to the thing I want, it printed true, then I swapped the text with a normal string like “hello” and it still didn’t change.
on this line youre doing nothing with the string you just used gsub on, if you want to change the text of the textbox then you should do something like this:
script.Parent.Text = string.gsub(tostring(script.Parent.Text), i, '<font color="'..v..'">'..i.."</font>", 1)