generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Adding Position according to last

Previous Thread :: Next Thread 
Seizurezxzz is not online. Seizurezxzz
Joined: 12 Feb 2013
Total Posts: 1297
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
Seizurezxzz is not online. Seizurezxzz
Joined: 12 Feb 2013
Total Posts: 1297
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
Seizurezxzz is not online. Seizurezxzz
Joined: 12 Feb 2013
Total Posts: 1297
19 Jul 2014 12:42 PM
Actually, maybe I should use table.foreach
I think that will work better than pairs
Report Abuse
deathknight306 is not online. deathknight306
Joined: 15 Jan 2008
Total Posts: 183
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
Seizurezxzz is not online. Seizurezxzz
Joined: 12 Feb 2013
Total Posts: 1297
19 Jul 2014 12:56 PM
I already indexed the TextLabel as a clone ("h")
Report Abuse
deathknight306 is not online. deathknight306
Joined: 15 Jan 2008
Total Posts: 183
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
Seizurezxzz is not online. Seizurezxzz
Joined: 12 Feb 2013
Total Posts: 1297
19 Jul 2014 01:00 PM
Oi, thanks!
Can't believe I diden't think of that sooner...
Report Abuse
deathknight306 is not online. deathknight306
Joined: 15 Jan 2008
Total Posts: 183
19 Jul 2014 01:05 PM
No problem, good luck on whatever your making!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image