|
| 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 |
|
|
| |
|
|
| 15 Jan 2015 12:26 PM |
Anyone have any ideas why this isn't moving?
|
|
|
| Report Abuse |
|
|
|
| 15 Jan 2015 12:28 PM |
| its meant to print 220 stop acting like its not |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 15 Jan 2015 12:35 PM |
CurrentPosition = CurrentPosition + 200
But I did. |
|
|
| Report Abuse |
|
|
|
| 15 Jan 2015 12:38 PM |
20 + 200 = 220
thats why it printed 220
|
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 15 Jan 2015 12:41 PM |
| What would I change that line to then? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 15 Jan 2015 12:53 PM |
| what exactly are you trying to do with the position of the new gui? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 15 Jan 2015 01:01 PM |
| Could you come to my place with me? You can see the problem there. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 15 Jan 2015 01:30 PM |
Tried it. Said that it got a number instead of an UDim2 value. |
|
|
| Report Abuse |
|
|