|
| 19 Jul 2014 12:16 PM |
I'm trying to create sort a logs thing for my script,
h = logs:Clone() h.Parent = Add2Frame h.Position = UDim.new(((#LOGSFILE) + .3), 0, 0, 0)
I'm trying to, when I create a new Gui, move it's Udim2 Position .3 down from the previous one. That code is how I though you could do it, but it errors and says:
UDim2 Expected, got UserData
Any know how I could do this? |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2014 12:18 PM |
LOGSFILE is a Table, I thought I could just get the lenth of the table and add .3 to it, to set the UDim.
|
|
|
| Report Abuse |
|
|
|
| 19 Jul 2014 12:42 PM |
Actually, maybe I should use table.foreach I think that will work better than pairs |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2014 12:48 PM |
h.Position = UDim.new(((#LOGSFILE) + .3), 0, 0, 0) I believe this line should be UDim2.new for one. As for what you are actually asking, you could have one variable set to the position of the last gui made and simply add on to that.
curpos = UDim2.new(0, 0, 0, 0) local gui = Instance.new("Frame") gui.Position = curpos + UDim2.new(0.3, 0, 0, 0) curpos = gui.Position local guib = Instance.new("Frame") guib.Position = curpos + UDim2.new(0.3, 0, 0, 0) curpos = gui.Position
You could also make a function that creates the gui instead of adding curpos = gui.Position to each line. |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2014 12:56 PM |
| I already indexed the TextLabel as a clone ("h") |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2014 12:59 PM |
Im not sure if I completely am understanding what you are saying there, so excuse me if im wrong here. If you already are doing something like local h = blah:clone() You can just create the next gui and base its position off h newgui.Position = h.Position + UDim2.new(0.3, 0, 0, 0) |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2014 01:00 PM |
Oi, thanks! Can't believe I diden't think of that sooner... |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2014 01:05 PM |
| No problem, good luck on whatever your making! |
|
|
| Report Abuse |
|
|