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 » Scripters
Home Search
 

Re: coroutine/thread help?

Previous Thread :: Next Thread 
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
03 Mar 2016 07:02 AM
Active.Changed:connect(function()
if Active.Value == true then
repeat Drop() until Active.Value == false
elseif Active.Value == false then
print 'iron off'
end
end)

--
Active is a defined bool value. When it's changed from false back to true, it creates a new thread with the repeat loop and they never stop when Active.Value == false. I think I could use coroutines to solve this problem, and I tried but I'm not quite sure how to yield correctly..can anyone give me some pointers on this?
Report Abuse
HumanXerxes is not online. HumanXerxes
Joined: 17 Apr 2011
Total Posts: 1351
03 Mar 2016 08:58 AM
The problem may lie within Drop(), what does it do? Make sure it has a yield within it, such as wait(), otherwise it would crash.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
03 Mar 2016 08:59 AM
fixed the problem
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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