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 |
|
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 30 Jul 2014 10:12 PM |
while wait(1/30) do
--things
end |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
| |
|
|
| 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
|
  |
| Joined: 12 Feb 2010 |
| Total Posts: 307 |
|
|
| 31 Jul 2014 10:03 PM |
| I meant to say without crashing. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|