EliteTCer
|
  |
| Joined: 17 Dec 2008 |
| Total Posts: 5174 |
|
|
| 08 Jun 2014 05:20 PM |
When I say "for i = 0,.1,.5 do" then I state where I need the variable, it only uses it once. I am needing to use the variable 3 times.
function Open() for i = 0,.1,.5 do wait(.2) Gui.Position = UDim2.new(i,0,0,0) Gui2.Position = UDim2.new(i,0,0,0) Gui3.Position = UDim2.new(i,0,0,0) end end
script.Parent.MouseButton1Up:connect(Open) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 08 Jun 2014 05:22 PM |
i is a variable = is an operator 0 is the starting number .1 is the end number .5 is the increment.
You're asking the loop to increase from 0 to .1 by .5
0 + .5 = .5, not .1
try: i = 1,3,1 |
|
|
| Report Abuse |
|
|
EliteTCer
|
  |
| Joined: 17 Dec 2008 |
| Total Posts: 5174 |
|
|
| 08 Jun 2014 05:23 PM |
| Oh woops, but still that isn't what I'm asking. |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2014 05:25 PM |
| You should be able to use the variable for all three... |
|
|
| Report Abuse |
|
|
EliteTCer
|
  |
| Joined: 17 Dec 2008 |
| Total Posts: 5174 |
|
|
| 08 Jun 2014 05:26 PM |
| It only moves the first one (Gui1) |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 08 Jun 2014 05:29 PM |
try making a table of the guis, then using in pairs to process them seperately:
guis = {Gui, Gui2, Gui3}
for i = 1,3 do -- assumes increment is 1 for i,v in pairs (guis) do v.Position = UDim2.new (i/10,0,0,0) end end |
|
|
| Report Abuse |
|
|
robomax11
|
  |
| Joined: 07 Jul 2011 |
| Total Posts: 6828 |
|
|
| 08 Jun 2014 05:32 PM |
coroutine.resume(coroutine.create(function() ^ is what you want. will make it happen all togther at once not one at a time.
guis = {Gui, Gui2, Gui3}
for i = 1,3 do -- assumes increment is 1 for i,v in pairs (script.Parent.GUIS:GetChildren()) do --- change this coroutine.resume(coroutine.create(function() v.Position = UDim2.new (i/10,0,0,0) end end
ˢᶦᵈᵉ ᵉᶠᶠᵉᶜᵗˢ ᵐᵃʸ ᶦᶰᶜᶫᵘᵈᵉ﹕ ᶫᵃᶜᵗᵃᵗᶦᶰᵍ, ʰᵉᵃᵈ ᵉˣᵖᶫᵒᵈᶦᶰᵍ ˢʸᶰᵈʳᵒᵐᵉ, ᵃᶰᵈ ᶫᵒˢˢ ᵒᶠ ᵍᵉᶰiᵗᵃᶫˢ |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 08 Jun 2014 05:33 PM |
| Right, because in pairs will do them separately. |
|
|
| Report Abuse |
|
|