Hello, I am currently struggling with my UI Gradient script, any help would be much appreciated.
local text = "@" .. game.Players.LocalPlayer.Name
local syntaxPatterns = {
["(@%s+)([a-zA-Z0-9]+)"] = '<font color="rgb(255,255,255)">' .. text .. '</font>',
["(function%s+)([a-zA-Z0-9]+)"] = '<font color="rgb(255,0,0)">%1</font><u>%2</u>',
}
local function HighlightSyntax(source)
for pattern, repl in pairs(syntaxPatterns) do
source = string.gsub(source, pattern, repl)
end
return source
end
local function Update()
script.Parent.Text = HighlightSyntax(script.Parent.Text)
end
Update()
What am I trying to achieve?
Where you see how I coloured certain parts of my text I want to replace that colour but with a gradient. I am struggling a lot, any help would be much appreciated.