-
What do you want to achieve?
I want to change “>” to “>” (with the ; at the end ofc) and make it render correctly -
What is the issue? Include screenshots / videos if possible!

-
What solutions have you tried so far? Did you look for solutions on the Creator Hub?
yes. i have looked but there isn’t a SINGLE post about this. no matter what I tried it just doesn’t work
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local StaticSyntax = {
["local"] = '<font color="#ff0000">local</font>',
["cool"] = '<font color="#00ff00">cool</font>',
["blue"] = '<font color="#0000ff">blue</font>',
['"(.-)"'] = '<font color="#55ff7f">"%1"</font>',
}
local SyntaxReplacing = true
function ReturnReplaceSyntax()
local Code:string = script.Parent.Text
if SyntaxReplacing == false then return Code end
Code = Code:gsub("<","<")
Code = Code:gsub(">",">")
Code = Code:gsub('"',""")
Code = Code:gsub("'","'")
Code = Code:gsub("&","&")
for word,replace in pairs(StaticSyntax) do
Code = Code:gsub(word,replace)
end
return Code
end
script.Parent:GetPropertyChangedSignal("Text"):Connect(function()
script.Parent.TextLabel.Text = ReturnReplaceSyntax()
end)
Please help. It works if I put it in manually through properties but does NOT work when I change via code
EDIT:
the “&” character works but only “>” and “<” are broken.
also here is the updated script
local StaticSyntax = {
["local"] = '<font color="#ff0000">local</font>',
["cool"] = '<font color="#00ff00">cool</font>',
["blue"] = '<font color="#0000ff">blue</font>',
}
local DynamicSyntax = {
['"(.-)"'] = '<font color="#55ff7f">"%1<"</font>',
["'(.-)'"] = '<font color="#55ff7f">'%1<'</font>',
}
local SyntaxReplacing = true
function ReturnReplaceSyntax()
local Code:string = script.Parent.Text
if SyntaxReplacing == false then return Code end
Code = Code:gsub("<","<")
Code = Code:gsub(">",">")
Code = Code:gsub("&","&")
for word,replace in pairs(DynamicSyntax) do
Code = Code:gsub(word,replace)
end
for word,replace in pairs(StaticSyntax) do
Code = Code:gsub(word,replace)
end
return Code
end
script.Parent:GetPropertyChangedSignal("Text"):Connect(function()
script.Parent.TextLabel.Text = ReturnReplaceSyntax()
end)
