I am trying to do a very strange match up between variables in a loop, may i have help?
Asked by
7 years ago Edited 7 years ago
Lets say for example I have a frame and in that frame is a bunch of ImageButtons and in those ImageButtons are a bunch of Values and if those values were different like 1,2,3,4,5,6 how would i create a loop to find 1,2 or 3,4 or 5,6?
(In the scrolling frame, there are buttons and in those buttons are values like 1,2,3,4,5)
Any Help?
This is the script i created:
(NewCounter is the incrementing value)
02 | for _, v in pairs (script.Parent.Parent.Parent.ScrollingFrame:GetChildren(firstValue, secondValue)) do |
03 | if v:FindFirstChild( "NewCounter" ) then |
05 | NewCounter = v:FindFirstChild( "NewCounter" ) |
06 | OtherCounter = v:FindFirstChild( "NewCounter" ) |
07 | if NewCounter.Value = = firstValue then |
09 | firstValue = firstValue + 1 |
10 | secondValue = secondValue + 1 |
11 | print (OtherCounter.Value) |
12 | if OtherCounter.Value = = secondValue then |
14 | NewCounter.Value = OtherCounter.Value |
15 | NewCounter.Parent.Position = OtherCounter.Parent.Position |
16 | print ( "Weird script..." ) |
21 | until OtherCounter.Value = = secondValue |
Any help would be great, tell me if I need to add something more or if something is wrong with this question...