How To The Roblox Rich Text Module?

So, I was told this Roblox Rich Text Module (Rich-Text-Markup.rbxm) could create Rich Text inside of Roblox. The thing is, i’m stuck on adding colour to my text. This is my current script.

local lex = require(script.Parent.Lexer)
local rich = require(script.Parent.RichText)

while wait(1) do
	for token,src in lex.scan(script.Parent.TextBox.Text) do
		if token == 'number' then
			rich:New(script.Parent.TextBox, "<color=Red>"..src.."<color=/>")
		end
	end
end

The lexer is by @boatbomber.

Thanks :smiley:

I haven’t worked with the Rich Text Markup module before, but from reading the API, it seems that the tags are case sensitive? If everything in your code is working except for the colours not changing, then that could be your problem. Try using capitals at the starts of your tags.

"<Color=Red>"..src.."<Color=/>"

What the specific issue is is fairly unclear otherwise.

1 Like

Sorry. Just got back from school. There seems to still be no colour. Would you like the original Error Message?

@Defaultio Could you probably help with this, please?

@colbert2677 I just thought of this. Since the Lexer only returns the part that was a number, wouldn’t I have to use some other way for this?

In markdown you don’t say:

<Color>src<Color=/>

You’d do:

<Color="Red">src</Color>
<!---
In your case: "<Color=Red>"..src.."</Color>"
-->

Still doesn’t seem to work.

There is no point in using this when roblox already has a feature with ui elements called markdown

Are you talking about the Roblox Rich Text feature?

It’s still in Beta though. It’s not Live yet.

Still, it’ll be live very soon, UICorner was announced beta a week before it was released, so you can wait for this to be fully released

You can enable it as a beta feature and test it out before it becomes live if you didn’t know yet.

I do know but, thanks for pointing it out. The thing is, I want to use this in the Main Game so… yea.