As the title of my question indicates, I am looking at creating a label for a player Gui in Roblox using only code. Under the folder StarterGui, I have a ScreenGui, and as a child of ScreenGui I have a local script with the following code:
local ScreenGui = script.Parent local label = Instance.new("TextLabel", ScreenGui) label.Size = UDim2.new({0, 200},{0, 100}) label.Text = "label" label.TextColor3 = Color3.new (0,0,0) label.TextSize = 36 label.Font = "Arial" label.TextScaled = true
I am pretty sure I should be seeing a label with the word ''label'' by now, but nothing. What am I missing?
Line 3, Remove the curly brackets. For some reason putting in the UDim2.new
function returns with 0,0,0,0
.
Here's a comparison:
print( UDim2.new(0, 200,0, 50) ) --> {0, 200}, {0, 50} print( UDim2.new({0, 200},{0, 50})) --> {0, 0}, {0, 0}