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: Help With Coroutines?

Previous Thread :: Next Thread 
j1my3p1x is not online. j1my3p1x
Joined: 16 Jan 2010
Total Posts: 978
17 Aug 2014 09:13 AM
I'm doing something for debugging and I need a coroutine to break the script, not just the coroutine thread. How could I do this?

I resume a coroutine that does error() but the coroutine stops, not the rest of the script.
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
17 Aug 2014 09:16 AM
Use boollean
Report Abuse
blockoo is not online. blockoo
Joined: 08 Nov 2007
Total Posts: 17202
17 Aug 2014 09:21 AM
Wow, I had this exact same question yesterday. There's a really complex way to do it with metatables, but more simply you can just use script.Disabled = true
Report Abuse
blockoo is not online. blockoo
Joined: 08 Nov 2007
Total Posts: 17202
17 Aug 2014 09:24 AM
Or, if that's not satisfying, I think I found another way:

function breakScript()
--do some stuff
return "error('Script broken')"
end

loadstring(coroutine.wrap(breakScript)())()
Report Abuse
j1my3p1x is not online. j1my3p1x
Joined: 16 Jan 2010
Total Posts: 978
17 Aug 2014 09:27 AM
Oh right, script.Disabled. Gosh I feel stupid. Thanks!
Report Abuse
blockoo is not online. blockoo
Joined: 08 Nov 2007
Total Posts: 17202
17 Aug 2014 09:28 AM
Actually, using Disabled will allow it to complete a function instead of killing the script exactly when you want it to error. Not sure if this will be a problem for you or not, though.
Report Abuse
j1my3p1x is not online. j1my3p1x
Joined: 16 Jan 2010
Total Posts: 978
17 Aug 2014 09:41 AM
Not really a problem.
I just need to pause a script after X amount of seconds to see how accurate my timer thing is and tweak it.

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