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 » Scripters
Home Search
 

Re: Gui not moving; stuck in one place.

Previous Thread :: Next Thread 
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
15 Jan 2015 12:10 PM
Hello all,

I am currently confused to why my GUI is in the same position. I am basically creating an automatic shop system, so I can enter the product info into the table, and it creates a new GUI, well a clone of one. I have defined everything as well.
Here is it:

for i, v in pairs(ShopThings) do
local NewTemplate = ShopItems:WaitForChild("ShopSelectionTemplate"):Clone()
local CurrentPosition = 20
NewTemplate.Parent = ShopItems
NewTemplate.Visible = true
NewTemplate.Name = v[1]
NewTemplate.Position = UDim2.new(0.0, CurrentPosition, 0.14, 0)
NewTemplate:WaitForChild("ProductName").Text = v[1]
NewTemplate:WaitForChild("ProductPrice").Text = v[3]
NewTemplate:WaitForChild("CreatorName").Text = v[6]
NewTemplate:WaitForChild("ProductPicture").Image = "rbxassetid://"..v[5]
NewTemplate:WaitForChild("DescInfo").Value = v[2]
NewTemplate:WaitForChild("IsBought").Value = v[4]
print(v)
CurrentPosition = CurrentPosition + 200
print(CurrentPosition)

end

It always prints 220, and I have 3 items in the table. All the GUIS stack on top of each other.

Thanks in advance.
Report Abuse
apricotdew is not online. apricotdew
Joined: 21 Aug 2012
Total Posts: 427
15 Jan 2015 12:22 PM
Abjuring meat is the fix.
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
15 Jan 2015 12:26 PM
Anyone have any ideas why this isn't moving?
Report Abuse
apricotdew is not online. apricotdew
Joined: 21 Aug 2012
Total Posts: 427
15 Jan 2015 12:28 PM
its meant to print 220 stop acting like its not
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
15 Jan 2015 12:32 PM
Why?
It should be 440, since their is 3 items in the table, and the GUI's are in the same place.
Report Abuse
apricotdew is not online. apricotdew
Joined: 21 Aug 2012
Total Posts: 427
15 Jan 2015 12:34 PM
"local CurrentPosition = 20"

This is the only place you are stating the variable; no where else do you change it.

Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
15 Jan 2015 12:35 PM
CurrentPosition = CurrentPosition + 200

But I did.
Report Abuse
apricotdew is not online. apricotdew
Joined: 21 Aug 2012
Total Posts: 427
15 Jan 2015 12:38 PM
20 + 200 = 220

thats why it printed 220

Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
15 Jan 2015 12:39 PM
But, if I changed the value of CurrentPosition, and said:
NewTemplate.Position = UDim2.new(0.0, CurrentPosition, 0.14, 0)
Why is "CurrentPosition" still 20?
Report Abuse
apricotdew is not online. apricotdew
Joined: 21 Aug 2012
Total Posts: 427
15 Jan 2015 12:40 PM
"NewTemplate.Position = UDim2.new(0.0, CurrentPosition, 0.14, 0)" only sets the position of "NewTemplate" to coordinates, with the Y coordinate equal to "currentposition"
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
15 Jan 2015 12:41 PM
What would I change that line to then?
Report Abuse
apricotdew is not online. apricotdew
Joined: 21 Aug 2012
Total Posts: 427
15 Jan 2015 12:44 PM
If you are trying to change the position, you would do:

NewTemplate.Position = UDim2.new(0.0, CurrentPosition + 20, 0.14, 0)
but im not sure that's what you mean
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
15 Jan 2015 12:47 PM
I changed the line to your one, but it is still the same.

You can see the problem here:
http://www.roblox.com/The-Mental-Murderer-ALPHA-UPDATES-place?id=192130109
Report Abuse
apricotdew is not online. apricotdew
Joined: 21 Aug 2012
Total Posts: 427
15 Jan 2015 12:53 PM
what exactly are you trying to do with the position of the new gui?
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
15 Jan 2015 12:58 PM
Im using a Scrolling Frames, and I want the new GUI to be 200 away from the new one. So you can see each one properly.
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
15 Jan 2015 01:01 PM
Could you come to my place with me? You can see the problem there.
Report Abuse
apricotdew is not online. apricotdew
Joined: 21 Aug 2012
Total Posts: 427
15 Jan 2015 01:09 PM
local CurrentPosition = ShopItems:WaitForChild("ShopSelectionTemplate").Position.X
NewTemplate.Position = UDim2.new(0.0, CurrentPosition + 50, 0.14, 0)

If shopselectiontemplate had a position, it could work try it
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
15 Jan 2015 01:30 PM
Tried it.
Said that it got a number instead of an UDim2 value.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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