|
| 26 Jan 2015 04:09 PM |
Frames = { script.Parent:WaitForChild("CitizensTeam"), script.Parent:WaitForChild("TroopsTeam"), script.Parent:WaitForChild("RoyaltyTeam"), script.Parent:WaitForChild("CommanderTeam") }
for i, v in pairs(Frames) do Buttons = {"Citizens", "Troops", "Royalty", "Commanders"} for i, v in pairs(Buttons) do --Script end end
--All of the Buttons are Children of the Team Frames. |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 26 Jan 2015 04:11 PM |
It'd kinda work but I have no idea why you're doing that. 1) You're reusing i and v - might be what you intended by can be bad practice 2) Move the buttons declaration out of the loops (and use local) 3) What are you trying to do? If you're adding each button to the frame then you might want to use a numeric for to preserve order. |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2015 04:11 PM |
Don't declare Buttons repeatedly, and even if you did, it should be local. Put Buttons at the top.
Yes, it would work. The inner loop would use the i and v for the inner loop, the outer loop would use the outer loop's. |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2015 04:19 PM |
Alright.
"I like to program." - Bosswalrus |
|
|
| Report Abuse |
|
|