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: Does while true do lag your game?

Previous Thread :: Next Thread 
SameySam is not online. SameySam
Joined: 22 Mar 2012
Total Posts: 11040
25 Oct 2016 06:36 PM
?
Report Abuse
Real_Spooky is not online. Real_Spooky
Joined: 23 Oct 2013
Total Posts: 3149
25 Oct 2016 06:39 PM
If there's no delay until something in the function yields, it will almost certainly crash it.
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
25 Oct 2016 06:44 PM
a while loop with no yield will certainly crash your game

anyway, I would argue that while loops aren't inherently laggy, what matters is how much stuff you do in them how often
Report Abuse
liIyacthy is not online. liIyacthy
Joined: 21 Sep 2015
Total Posts: 102
26 Oct 2016 12:04 AM
add a yield

ex:

while 2+2 == 4 do
wait()
print("you're correct kiddo")
end

--if you dont have a yield the script will run at an extreme rate, faster than roblox can handle and will lag/crash your game/studios
Report Abuse
katpup1234 is not online. katpup1234
Joined: 12 Feb 2014
Total Posts: 1728
26 Oct 2016 12:05 AM
Add a delay at the end.

AKA : wait(.1)


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