Richtext not working correctly

I am currently making a script for an admin Gui in which you can temp ban, server ban, perma-ban, etc, and there’s a text label that uses RichText. Whenever I change the FontFace to permanent marker, it never changes back.

--This works!
script.Parent.Text = "<b><i><font face='PermanentMarker'><font color='rgb(255, 0, 0)'><font size='40'>PERMA-BAN</font></font></font></i></b><font face='Nunito'><font color='rgb(255, 0, 0)'><font size='30'><b>  A PLAYER</b></font></font></font>"
--After it runs however, this will not work
script.Parent.Text = "<font face='FredokaOne'>TEST</font>"
--The second one will work if I haven't ran the first one yet

They work if ran together, such as if I put them at the beginning of the script. But as soon as I add a wait() or when I do this:

num:GetPropertyChangedSignal("Value"):Connect(function()
	if num.Value == 1 then
		script.Parent.Text = "<b><i><font face='PermanentMarker'><font color='rgb(255, 0, 0)'><font size='40'>PERMA-BAN</font></font></font></i></b><font face='Nunito'><font color='rgb(255, 0, 0)'><font size='30'><b>  A PLAYER</b></font></font></font>"
	elseif num.Value == 2 then
		script.Parent.Text = "<font face='FredokaOne'>TEST</font>"
	end
end)

The “TEST” is in permanent marker, is bolded, and is in italics for some reason.

1 Like

Setting the font outside of RichText works

num:GetPropertyChangedSignal("Value"):Connect(function()
	if num.Value == 1 then
		script.Parent.Font = Enum.Font.PermanentMarker
		script.Parent.Text = "<b><i><font color='rgb(255, 0, 0)'><font size='40'>PERMA-BAN</font></font></i></b><font face='Nunito'><font color='rgb(255, 0, 0)'><font size='30'><b>  A PLAYER</b></font></font></font>"
	elseif num.Value == 2 then
		script.Parent.Font = Enum.Font.FredokaOne
		script.Parent.Text = "TEST"
	end
end)

This is an engine bug, I’ve been able to reproduce this, but I’m not sure who to contact to get it posted, as I don’t have permissions to make a bug report.

repro.rbxl (59.6 KB)

local label = script.Parent

-- note: for my own testing, anything above task.wait(0.05) breaks and below it works fine

label.Text = "<b><i><font face='PermanentMarker'><font color='rgb(255, 0, 0)'><font size='40'>PERMA-BAN</font></font></font></i></b><font face='Nunito'><font color='rgb(255, 0, 0)'><font size='30'><b>  A PLAYER</b></font></font></font>"
task.wait(0.5) -- Adding a yield makes the font-changing break
label.Text = "<font face='FredokaOne'>Test</font>"

Expected behavior:
image

Current behavior:
image

Edit: found someone who already reported it:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.