Hello, i am trying to create this script that gets all the objects in a folder and creates a text label for everyone of them in a ScrollingGui, The script sizes it as should and positions it as should but stuff like the text is invisible and the background is invisible.
Here is my code:
script.Parent.MouseButton1Down:Connect(function()
local list = script.Parent.Parent.Parent.Folder
for i,v in pairs(list:GetChildren()) do
local label = Instance.new("TextLabel")
label.Name = tostring(i)
label.Text = v.Name
label.BackgroundColor3 = Color3.new(67, 67, 67)
label.BorderSizePixel = 0
label.TextColor3 = Color3.new(255, 255, 255)
label.TextSize = 18
label.TextXAlignment = Enum.TextXAlignment.Left
label.TextYAlignment = Enum.TextYAlignment.Center
label.Size = UDim2.new(0, 251, 0, 31)
label.ZIndex = 10
if i == 1 then
label.Position = UDim2.new(0, 0, 0, 0)
else
local lastlabel = script.Parent.Parent.ListContent:FindFirstChild(tostring(i - 1))
label.Position = UDim2.new(0, 0, 0, lastlabel.Position.X.Offset + lastlabel.Size.Y.Offset)
end
label.Parent = script.Parent.Parent.ListContent
end
end)
If enyone can help me that would be great!

3 comments
TL;DR
change "Color3.new()" to "Color3.fromRGB()"
Thank You OnaKat! I tried your suggestion and it worked! You should have made an awenser instead of a comment so i can accept it.