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: Stop a running coroutine in a loop?

Previous Thread :: Next Thread 
Seranok is not online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
17 Jul 2011 05:33 PM
local Timer = coroutine.create(
function()
repeat
print(Time)
wait(1)
Time = Time - 1
until Time < 1
end)

wait(5)

coroutine.abort()???

How do I stop that?
Report Abuse
OBF is not online. OBF
Joined: 29 Sep 2009
Total Posts: 10709
17 Jul 2011 05:45 PM
coroutine.yeild(func)
Report Abuse
Seranok is not online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
17 Jul 2011 05:50 PM
In a loop...
Report Abuse
DingDong272 is not online. DingDong272
Top 100 Poster
Joined: 08 Dec 2007
Total Posts: 9860
17 Jul 2011 05:52 PM
continuously stop the running coroutine?

while true do
wait(3)
coroutine.yield(corout)
end
?
Report Abuse
Seranok is not online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
17 Jul 2011 05:55 PM
I want to have a Timer running inside this script

So that it will continually tick down unless stopped

Unless somewhere in the script coroutine.yield(cor) is called
Report Abuse
DingDong272 is not online. DingDong272
Top 100 Poster
Joined: 08 Dec 2007
Total Posts: 9860
17 Jul 2011 06:00 PM
Ok, so add an if statement that checks for whatever and if it returns true, yield the coroutine.
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