Rich Text through Remote Event not working

Hello, I made a notification system and I want to use Rich Text to change the color of a specific word in the string.

The way it works is that you fire an remote event to the client that creates a text/the notification with the string that you use when you fire the event.

The problem is that I get this error when trying to use the example on the Roblox creator hub. Also when I tried with bold I got no error but the text didn’t go bold.

Object.Script:27: Expected ‘)’ (to close ‘(’ at column 22), got ‘#’ - Studio - Script:27

How could I solve the issue?

firing the remote:

 remote:FireClient(plr,"I want the <font color="#FF7800">orange</font> candy.")
 local function Create(value)
	local newlabel = exlabel:Clone()
	newlabel.Parent = frame
	newlabel.Text = value
	local tween1 = ts:Create(newlabel,ti2,{TextTransparency = 0}):Play()
	task.wait(3)
	local tween = ts:Create(newlabel,ti,{TextTransparency = 1}):Play()
	task.wait(2.5)
	newlabel:Destroy()
	
end

remote.OnClientEvent:Connect(function(value)
	Create(value)
end)

Note that I am not familiar with Rich Text. Also, the scripts I provided are just the important stuff, just so you know.

The issue is this.
You close the string of text before the #, and restart it after the 0.
In order to have the " within the string itself, try replacing the " before the I at the start, and after the . at the end. with ’

2 Likes

It works! thank you for the help. Just one more thing tho, how can I modify the tool’s name in the following code since it isn’t a string?
remote:FireClient(hit,“succesfully purchased “…tool.Name…”!”)

wdym?

1 Like

Like making the tool’s name bold, or a specific color in the text

Oh. You would do that the same way as you did before.
Replace the " with ', then have the first string end after >, and the second one (after the tool name) just before the <

e.g.

local string = 'The tool is <b>' .. tool.Name .. '</b>'
1 Like

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