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: What's coroutine?

Previous Thread :: Next Thread 
ibracadabra is not online. ibracadabra
Joined: 03 Nov 2010
Total Posts: 1860
03 Jan 2013 10:23 AM
[ Content Deleted ]
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
03 Jan 2013 10:24 AM
You use it when you want to run two codes at the same time. Think of updating GUIs... I cannot think of a good example so fast.
Report Abuse
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
03 Jan 2013 10:26 AM
Can also be used to return errors in code.
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
03 Jan 2013 10:28 AM
What? Coroutines normally don't return errors ;)
Report Abuse
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
03 Jan 2013 10:33 AM
Coroutine continue I am pretty sure it does have a Arguement you can register for that
Report Abuse
FreeToTake is not online. FreeToTake
Joined: 21 Apr 2010
Total Posts: 1827
03 Jan 2013 10:36 AM
coroutine.resume(coroutine.create(function()
while true do
print("coroutine running")
wait(2)
end
end))

while true do
print("while loop running")
wait(2)
end

basically, a coroutine runs on it's own thread (which causes lag).
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
03 Jan 2013 11:04 AM
> Coroutines normally don't return errors ;)

assert(coroutine.resume(coroutine.create(function() printtttttttttt("x") end)))
Report Abuse
B0ttle is not online. B0ttle
Joined: 31 Dec 2012
Total Posts: 63
03 Jan 2013 11:07 AM
It's a loop that doesnt "stop" the script. I mean it's a loop that plays on "background", you see what i mean ?
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
03 Jan 2013 11:16 AM
"Normally".
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
03 Jan 2013 11:17 AM
I'm not going to explain things right now as I'm on my phone. I'll explain when I get home.
None of these dedinitions are adequate so far
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
03 Jan 2013 11:18 AM
What do you mean "normally"? They always do, as long as there is an error. If there isn't then obviously they won't, because there's no error to return.
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
03 Jan 2013 11:24 AM
If you yield within the coroutine with wait it won't return any errors.
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