RichText and string.sub

Hello! I’m making a dialog UI in my game which uses the typewriter style. Say I wanted to make some bold text, I’d get this because RichText tags need a <> and </>.

What’s the best way to go about making the two compatible?

All you would have to do is something like this:

local textToType = "Hello world!";
local richTextTemplate = "<b>%s</b>"

for i = 1, textToType:len() do
	script.Parent.Text = richTextTemplate:format(textToType:sub(1, i))
	wait()
end
11 Likes

It’s RichText not Text OP wants a RichText.

It should be understood that the RichText property of said TextLabel should be set to true.

2 Likes