generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: For loops

Previous Thread :: Next Thread 
andreas98 is not online. 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 is not online. 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 is not online. 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 is not online. Lowcart
Joined: 12 Sep 2011
Total Posts: 1323
25 Sep 2011 02:53 AM
[ Content Deleted ]
Report Abuse
andreas98 is not online. 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
natedogith1 is not online. natedogith1
Joined: 09 Aug 2008
Total Posts: 578
25 Sep 2011 04:04 AM
http://wiki.roblox.com/index.php/Function_Dump/Coroutine_Manipulation
Report Abuse
andreas98 is not online. 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
natedogith1 is not online. natedogith1
Joined: 09 Aug 2008
Total Posts: 578
25 Sep 2011 04:25 AM
coroutine.resume(coroutine.create(function()
--do stuff
end))
--do other stuff at the same time
Report Abuse
andreas98 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image