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: Loop Question

Previous Thread :: Next Thread 
iDomerius is not online. iDomerius
Joined: 12 Feb 2010
Total Posts: 307
30 Jul 2014 10:10 PM
How do I loop a script infinitely with crashing the game / studio?
Report Abuse
ROBLOXTHEMOVIEs is not online. ROBLOXTHEMOVIEs
Joined: 11 Jun 2012
Total Posts: 5895
30 Jul 2014 10:10 PM
while true do end
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
30 Jul 2014 10:12 PM
while wait(1/30) do

--things

end
Report Abuse
iDomerius is not online. iDomerius
Joined: 12 Feb 2010
Total Posts: 307
30 Jul 2014 10:17 PM
@roblox, thats what makes it crash

@128, that didnt work eaither.
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
30 Jul 2014 10:19 PM
"ThTs what makes it crash"
That's what you ask for ...
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
30 Jul 2014 10:32 PM
Mine does work.
Report Abuse
GiraffeRaging is not online. GiraffeRaging
Joined: 12 Sep 2010
Total Posts: 1861
30 Jul 2014 10:34 PM
Rephrase what you want, I think we're misunderstanding. It appears that you're asking for a script that crashes studio.

An example of this would be

while true do
print("crash")
end
Report Abuse
iDomerius is not online. iDomerius
Joined: 12 Feb 2010
Total Posts: 307
31 Jul 2014 10:03 PM
I meant to say without crashing.
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
31 Jul 2014 10:04 PM
while wait(1/30) do

--things

end

Will not crash
Report Abuse
blockoo is not online. blockoo
Joined: 08 Nov 2007
Total Posts: 17202
31 Jul 2014 10:05 PM
@128
Why are you using wait(1/30) instead of just wait()? They are essentially equal.
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
31 Jul 2014 10:07 PM
If you get into the habit of using wait(), and then use it in a local script, people can mess with your script

How long wait() is, is stored in the changeable studio settings
So if they change it, all client scripts will have new meaning for "wait()"
Report Abuse
Ludav is not online. Ludav
Joined: 28 Jul 2014
Total Posts: 112
31 Jul 2014 10:08 PM
People have different preferences. That's just how 128GB does it.

But I really wouldn't know.
Report Abuse
blockoo is not online. blockoo
Joined: 08 Nov 2007
Total Posts: 17202
31 Jul 2014 10:23 PM
If they changed the rendering framerate, aren't they already speedhacking anyway? Changing the definition of wait() to make their scripts run faster doesn't seem like a big deal anymore if they're already speedhacking.
Report Abuse
Jammer622 is not online. Jammer622
Joined: 19 Nov 2008
Total Posts: 1739
31 Jul 2014 10:57 PM
Back to the point..
"How do I loop a script infinitely with crashing the game / studio?"

Use a 'while true do' function with a wait() somewhere in it.
If you just use 'wait()', people can change it when it's in localscripts, but unless it's something like a continuous point giver, I wouldn't worry. Anything you want to be equal with all players, you should use in a server-sided script anyways. For a defined time, just put a number like wait(1) for one second, wait(2.5) for two and one half, etc.

while true do
wait()

--All your script stuff you want looped

end
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
31 Jul 2014 11:12 PM
@Block
I'm talking about the setting called DefaultWaitTime or whatever its called
Report Abuse
blockoo is not online. blockoo
Joined: 08 Nov 2007
Total Posts: 17202
01 Aug 2014 02:17 PM
Huh, I never noticed that before.
Still, you should define something like t = 1/30 at the beginning of your scripts. Would look much better.
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
01 Aug 2014 05:01 PM
I don't know about looking better but yah that way it wouldn't have to do the math every time
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