Okay so final, I’ve made something like this
local test = "<TextLabel properties='BackgroundTransparency=1;TextScaled=true;TextColor3=255,0,0;Size=1,0,1,0;Position=0,0,0,0' text='TEXT'> <TextButton style='' text='TEXT'>"
local parts = string.split(test, "<", ">")
for _, a in pairs(parts) do
if (a ~= "") then
local lbl = Instance.new(string.split(a, " ")[1])
lbl.Visible = false
lbl.Parent = script.Parent.Main.search.search
lbl.Text = string.gsub(string.gsub(string.split(string.split(a, " ")[3], "=")[2], ">", ""), "'", "")
local stringProperties = string.gsub(string.gsub(string.split(a, " ")[2], "properties=", ""), "'", "")
local tableProperties = string.split(stringProperties, ";")
for _, option in pairs(tableProperties) do
local optionVals = string.split(option, "=")
if (optionVals[1] == "Size") then
local sizes = string.split(optionVals[2], ",")
lbl.Size = UDim2.new(sizes[1], sizes[2], sizes[3], sizes[4])
elseif (optionVals[1] == "Position") then
local positions = string.split(optionVals[2], ",")
lbl.Position = UDim2.new(positions[1], positions[2], positions[3], positions[4])
elseif (string.find(optionVals[1], "Color3")) then
pcall(function()
local colors = string.split(optionVals[2], ",")
lbl[optionVals[1]] = Color3.new(colors[1], colors[2], colors[3])
end)
else
pcall(function()
lbl[optionVals[1]] = optionVals[2]
end)
end
end
lbl.Visible = true
end
end
It works perfectly.
Credits to @linuxisnotanos and myself lol.