andreas98
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 246 |
|
|
| 25 Sep 2011 02:24 AM |
Hello, I was wondering if there was a method where I could run two for loops in one script at the same time? This is the script:
gui = script.Parent.Parent
for i=1,100 do gui.Size = gui.Size + UDim2.new(0,2,0,0) wait() end
-- And I want to run two for loops at the same times.
Please help :) |
|
|
| Report Abuse |
|
|
grimm343
|
  |
| Joined: 18 Sep 2008 |
| Total Posts: 2796 |
|
|
| 25 Sep 2011 02:30 AM |
What were you planning on doing?
Loop in a loop Example of doing this..
local wksp = game.Workspace:GetChildren() for i=1, #wksp do if wksp[i].className == "Hint" or wksp[i].className == "Message" then wksp[i]:Remove() end local wkch = wksp[i]:GetChildren() for i=1, #wkch do if wkch[i].className == "Hint" or wkch[i].className == "Message" then wkch[i]:Remove() end end end
|
|
|
| Report Abuse |
|
|
andreas98
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 246 |
|
|
| 25 Sep 2011 02:35 AM |
| I just need a kind of a loop that can run two for loops at the same time instead of that the script run the first for loop and then the second for loop. |
|
|
| Report Abuse |
|
|
Lowcart
|
  |
| Joined: 12 Sep 2011 |
| Total Posts: 1323 |
|
| |
|
andreas98
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 246 |
|
|
| 25 Sep 2011 03:59 AM |
| Hmm thank I searched on the Roblox Wiki site but I couldn't understand it could you maybe write it as a script? |
|
|
| Report Abuse |
|
|
|
| 25 Sep 2011 04:04 AM |
| http://wiki.roblox.com/index.php/Function_Dump/Coroutine_Manipulation |
|
|
| Report Abuse |
|
|
andreas98
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 246 |
|
|
| 25 Sep 2011 04:23 AM |
| Thanks again but I can still not figure it out. Please help :) |
|
|
| Report Abuse |
|
|
|
| 25 Sep 2011 04:25 AM |
coroutine.resume(coroutine.create(function() --do stuff end)) --do other stuff at the same time |
|
|
| Report Abuse |
|
|
andreas98
|
  |
| Joined: 10 Sep 2008 |
| Total Posts: 246 |
|
|
| 25 Sep 2011 04:43 AM |
| Thank you so much :D It works perfectly :D |
|
|
| Report Abuse |
|
|