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: Killing a loop?

Previous Thread :: Next Thread 
RoyalBobby202 is not online. RoyalBobby202
Joined: 16 Apr 2011
Total Posts: 458
31 May 2017 01:54 PM
How can I create a loop within a function that I can later stop.
Report Abuse
Alimegacorn is online. Alimegacorn
Joined: 24 May 2013
Total Posts: 899
31 May 2017 02:05 PM
coroutines (pretty sure)
Report Abuse
Snowskateer is not online. Snowskateer
Joined: 06 Dec 2011
Total Posts: 4647
31 May 2017 02:07 PM
break?
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
31 May 2017 02:07 PM
Internally = break/change variable
Externally = change variable/coroutine but you probably don't need to


Report Abuse
bigboy77584 is online. bigboy77584
Joined: 06 Jan 2009
Total Posts: 1003
31 May 2017 02:29 PM
while wait() do
--do stuff
if something then
break -- break ends the loop
end
end


Report Abuse
AxonMega is online. AxonMega
Joined: 29 Aug 2014
Total Posts: 2403
31 May 2017 02:29 PM
coroutine.yield
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
31 May 2017 02:30 PM
@bigboy77584

Or...

while something do
-- do stuff
end


Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
31 May 2017 02:32 PM
"coroutine.yield"

Read the OP again.


Report Abuse
Mister_Manakin is not online. Mister_Manakin
Joined: 16 Sep 2009
Total Posts: 1935
31 May 2017 02:40 PM
local run = true

spawn(function()
while (run) do
print("running")
wait(1)
end
end)

wait(10)
run = false
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