Why wont my createlabel function work correctly?
I am trying to make it easier by making a function that makes textlabels automatically
When I do this they are all together in one position.
01 | local Plr = game.Players.LocalPlayer |
03 | local function Cc(Nme, Dsc, Prnt, Pos 1 ) |
04 | local t = Instance.new( "TextLabel" , Prnt) |
06 | t.BackgroundTransparency = 0.35 |
07 | t.BackgroundColor 3 = Color 3. new( 0 , 0 , 0 ) |
08 | t.Size = UDim 2. new( 0 , 280 , 0 , 15 ) |
10 | t.TextColor 3 = Color 3. new( 255 , 255 , 255 ) |
11 | t.FontSize = Enum.FontSize.Size 10 |
14 | t.Position = UDim 2. new( 0 , 7.5 , 0 , 0 +Pos 1 ) |
17 | if Plr and Plr.PlayerGui then |
18 | if Plr.PlayerGui:FindFirstChild( "CommandsInterface" ) then |
19 | game.Debris:AddItem(Plr.PlayerGui [ "CommandsInterface" ] , 0 ) |
21 | local S = Instance.new( "ScreenGui" , Plr.PlayerGui) |
22 | local F = Instance.new( "Frame" , S) |
23 | local Sc = Instance.new( "ScrollingFrame" , F) |
24 | local C = Instance.new( "TextButton" , F) |
25 | S.Name = "CommandsInterface" |
26 | F.Size = UDim 2. new( 0 , 300 , 0 , 300 ) |
27 | F.Position = UDim 2. new( 0.5 ,- 150 , 0.5 ,- 150 ) |
30 | F.BackgroundTransparency = 0.75 |
31 | F.BorderSizePixel = 3.5 |
32 | F.BorderColor 3 = Color 3. new( 255 , 255 , 255 ) |
33 | F.BackgroundColor 3 = Color 3. new( 0 , 0 , 0 ) |
35 | Sc.BackgroundTransparency = 1 |
36 | Sc.Position = UDim 2. new( 0 , 0 , 0 , 0 ) |
37 | C.TextColor 3 = Color 3. new( 255 , 255 , 255 ) |
38 | C.Font = Enum.Font.Arial |
39 | C.FontSize = Enum.FontSize.Size 14 |
40 | C.Position = UDim 2. new( 0 , 0 , 0 , 0 ) |
42 | C.Size = UDim 2. new( 0 , 10 , 0 , 10 ) |
43 | C.BackgroundTransparency = 1 |
44 | Cc( "t1" , "Shutdown [Owners]" ,Sc, 17 ) |
45 | Cc( "t2" , "Clean [All]" ,Sc, 17 ) |
46 | Cc( "t3" , "Fix [All]" ,Sc, 17 ) |
47 | Cc( "t4" , "Disco [All]" ,Sc, 17 ) |
48 | Cc( "t5" , "Music 'N' [All]" ,Sc, 17 ) |
49 | C.MouseButton 1 Down:connect( function () |
50 | game.Debris:AddItem(S, 0 ) |
Please help