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: coroutines

Previous Thread :: Next Thread 
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
14 Dec 2013 02:16 PM
are coroutines automatically while loops
like can i call it like this

function Source()
wait()
print("Hello World!")
end

local newCoroutine = coroutine.create(Source)

and it'll automatically make it while true do or do i have to do this

function Source()
while true do
wait()
print("Hello World!")
end
end

local newCoroutine = coroutine.create(Source)
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
14 Dec 2013 02:18 PM
coroutines are threads which allow the script to do more than one thing at a time they are not automatic while loops.
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
14 Dec 2013 02:20 PM
alright that makes sense
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
14 Dec 2013 02:31 PM
function Source()
while true do
wait()
print("Hello World!")
end
end

local newCoroutine = coroutine.create(Source)

if I do

coroutine.resume(newCoroutine)

it'd start the while loop

and then

coroutine.yield(newCoroutine)

would stop it?
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
14 Dec 2013 02:34 PM
bump
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