How do I make a certain word a color

I want to make my code executer text change color

I do not know how to change it

I have looked at devforum.roblox.com and youtube.com

I am making my code executer (not for virus btw) but I do not know how to make a certain word a certain color when it is in the same text box but I do not know what to add for the next things. I would love for help.

CodeBox.Text = --Do not know what too add

CodeBox:GetPropertyChangedSignal("Text"):Connect(function()
	CodeBox.Text = --do not know
	local term = CodeBox.Text
	if term ~= "" then
		local split = text:split(term)
		if #split - 1 > 0 then
			CodeBox.Text = table.concat(split, "<font color=\"#00ff00\">"..term.."</font>")
		end
	end
end)

@kaiyellow2008 Here I just @ you bro

I know but I do not need the local var text

So basically what’s going on in the script is that once a keyword is typed it puts that word into a text label and changes its color there.

1 Like

So how would I do it? Would I just do this:

local text = "local print lol etc."

What would I change label tooo?

Im actually still working on it so when I figure it out I’ll let you know

1 Like

You can use HTML inside of strings for more display with the RichText property enabled

So I just use RichText? I do not know HTML

1 Like

Just read whats been documented, it gives you basic information on how to color text

I know but it needs to be different colors for each keyword

I’m not 100% on how you would use it since I haven’t touched lua in a while and I’m not 100% on how string functions work. I would just replace the keyword orange with <font color="#FFA500">orange</font>