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: How often should I wait()?

Previous Thread :: Next Thread 
Laekim is not online. Laekim
Joined: 04 Oct 2012
Total Posts: 118
27 Dec 2012 07:21 PM
I have a script with this line in it:

    if math.random(1, 1000) == 1 then wait() end

But it's too slow.. Does anybody know a safe number I can put instead of 1,000 to make it faster?

(before I get any questions, I'm iterating 10^9 times to create a massive table. For a game :P
Report Abuse
shipmaster4000 is not online. shipmaster4000
Joined: 29 Apr 2010
Total Posts: 2050
27 Dec 2012 07:29 PM
you only need 1 wait per loop unless you acually want to wait for something.
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
27 Dec 2012 07:30 PM
Huh?
if math.random(1,25) == 1 then wait() end

Private Chat Gui: http://www.roblox.com/Private-Chat-GUI-item?id=101293225
Report Abuse
gametastic100 is not online. gametastic100
Joined: 15 Jun 2011
Total Posts: 1286
27 Dec 2012 07:31 PM
if math.random(1, 1000) == 1 then wait(0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001) end
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
27 Dec 2012 07:32 PM
game, the lowest you can wait is 1/30(or wait()).

Private Chat Gui: http://www.roblox.com/Private-Chat-GUI-item?id=101293225
Report Abuse
gametastic100 is not online. gametastic100
Joined: 15 Jun 2011
Total Posts: 1286
27 Dec 2012 07:32 PM
LolUmad? I cooked yur brainham.
Report Abuse
gametastic100 is not online. gametastic100
Joined: 15 Jun 2011
Total Posts: 1286
27 Dec 2012 07:33 PM
Cease, it was a joke lol. I've known that since I started scripting.
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
27 Dec 2012 07:33 PM
I really wish you were smarter...

Private Chat Gui: http://www.roblox.com/Private-Chat-GUI-item?id=101293225
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
27 Dec 2012 07:33 PM
By the, way I was responding to the LolUmad post.

Private Chat Gui: http://www.roblox.com/Private-Chat-GUI-item?id=101293225
Report Abuse
gametastic100 is not online. gametastic100
Joined: 15 Jun 2011
Total Posts: 1286
27 Dec 2012 07:34 PM
Ceasless, I wish you were smart enough to read the comment after that and stop insulting with no valid or legitimate reason...
Report Abuse
shipmaster4000 is not online. shipmaster4000
Joined: 29 Apr 2010
Total Posts: 2050
27 Dec 2012 07:34 PM
best argument ever....
Report Abuse
Laekim is not online. Laekim
Joined: 04 Oct 2012
Total Posts: 118
27 Dec 2012 07:35 PM
@shipmaster4000
I don't want one wait per loop. If it was just a standard wait() then the script would take to long. I want it to wait every once in awhile in a loop. In my example above, it waits close to every 1,000th iteration.

@Cease
That would make my script slower..

@game
That was the worst joke.. It had nothing to do with the question..

w/<​3
Report Abuse
gametastic100 is not online. gametastic100
Joined: 15 Jun 2011
Total Posts: 1286
27 Dec 2012 07:35 PM
Very much indeed sir....
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
27 Dec 2012 07:35 PM
game, it's called a late post, ever heard of it, or are you just that moronic?

Private Chat Gui: http://www.roblox.com/Private-Chat-GUI-item?id=101293225
Report Abuse
Laekim is not online. Laekim
Joined: 04 Oct 2012
Total Posts: 118
27 Dec 2012 07:36 PM
I hate how scripting helpers is just filled with idiots who think they can script.

w/<​3
Report Abuse
gametastic100 is not online. gametastic100
Joined: 15 Jun 2011
Total Posts: 1286
27 Dec 2012 07:36 PM
hey Laek. Like dis sacue boi? yeyeyeye it so soft and yummeh. Mmmhmm hmhmhmhhmhmhmhmhmh . Spampsamspamspsams
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
27 Dec 2012 07:36 PM
I maybe an idiot, but I can script, lol.

Private Chat Gui: http://www.roblox.com/Private-Chat-GUI-item?id=101293225
Report Abuse
gametastic100 is not online. gametastic100
Joined: 15 Jun 2011
Total Posts: 1286
27 Dec 2012 07:38 PM
And ceaseless and laekem, I think you guys need to get out before you guys get straight up embarrassed. I means seriously, calling someone hwo has a point moronic. That's pretty sad you resort to insults. Laekem, I doubt you cans cript either. No one asked for your guys' opinions. Idiots.
Report Abuse
Laekim is not online. Laekim
Joined: 04 Oct 2012
Total Posts: 118
27 Dec 2012 07:38 PM
> I maybe an idiot, but I can script, lol.

lol. Not really, considering you did the complete opposite of what I asked.

w/<​3
Report Abuse
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
27 Dec 2012 07:38 PM
Since no one is helping you, I will:

while true do
for i=1,1000
--code
end
wait()
end
Report Abuse
yomamadude6 is not online. yomamadude6
Joined: 21 Nov 2009
Total Posts: 2151
27 Dec 2012 07:39 PM
while true do
for i=1,1000 do
--code
end
wait()
end

oops, i forgot a do
Report Abuse
Laekim is not online. Laekim
Joined: 04 Oct 2012
Total Posts: 118
27 Dec 2012 07:39 PM
lol

I can script brah. It looks like you are the one that can't, considering you can't answer my question so you just try and make a joke to look funny.

w/<​3
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
27 Dec 2012 07:40 PM
@Laek;

You're going to have to fiddle with the numbers until it works as quickly as you want it to.

tick = 0;
for whatever do --Whatever loop line you're using.
tick = tick + 1;
whatever.block;
if (tick > 500) then --Mess with the 500
tick = 0;
wait(); -- Wait 1/30th of a second, the minimum.
end
end


This will barely slow the code execution at all but will remove any possible loop lag.
Report Abuse
Laekim is not online. Laekim
Joined: 04 Oct 2012
Total Posts: 118
27 Dec 2012 07:41 PM
> while true do
for i=1,1000 do
--code
end
wait()
end
oops, i forgot a do

What is this.. I don't even.. That would make my script crash, considering instead of 1,000 iterations, mine is doing 1,000,000,000 iterations..

w/<​3
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
27 Dec 2012 07:41 PM
game, at least I can spell. Lae, it would make it faster since it would have less possibilities.

Private Chat Gui: http://www.roblox.com/Private-Chat-GUI-item?id=101293225
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