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 do I make a script repeat endlessly.

Previous Thread :: Next Thread 
zorganBuilds is not online. zorganBuilds
Joined: 12 Oct 2012
Total Posts: 992
22 Oct 2012 06:27 AM
[ Content Deleted ]
Report Abuse
FurryLegoDude is not online. FurryLegoDude
Joined: 04 Oct 2012
Total Posts: 576
22 Oct 2012 06:51 AM
while true do

wait()

print("hello")

end
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
22 Oct 2012 09:27 AM
^^^^
Report Abuse
legalgohanss8 is not online. legalgohanss8
Joined: 23 Jul 2011
Total Posts: 89
22 Oct 2012 11:17 AM
You can do this:
while true do
wait(2)
end
Report Abuse
legalgohanss8 is not online. legalgohanss8
Joined: 23 Jul 2011
Total Posts: 89
22 Oct 2012 11:18 AM
Fixed one:
while true do
wait(0)
print("WASSUP NOOBS!!!")
end
Report Abuse
SourceLeak is not online. SourceLeak
Joined: 10 Jun 2012
Total Posts: 841
22 Oct 2012 01:03 PM
@legal

waiting for 0 seconds is redundant.

@Everyone

while wait() do
end

Less lines and more elegant.
Report Abuse
nominate10 is not online. nominate10
Joined: 20 May 2008
Total Posts: 2545
22 Oct 2012 01:09 PM
To go more in-depth, 'wait()', when a number is not specified, waits (what I think is, could be wrong) the shortest time possible, roughly 0.03 seconds.
Also, be careful not to have an endless loop without any kind of wait() in it, because it may crash your game.
Report Abuse
gijsbel11 is not online. gijsbel11
Joined: 07 Feb 2009
Total Posts: 4223
22 Oct 2012 01:14 PM
If roblox would enable >30 fps it would be less then 0.03 per update(client sided)
Report Abuse
StealthKing95 is online. StealthKing95
Joined: 13 Dec 2008
Total Posts: 4263
22 Oct 2012 02:11 PM
"If roblox would enable >30 fps it would be less then 0.03 per update(client sided)"

Its not about the framerate, its about game ticks
Report Abuse
SourceLeak is not online. SourceLeak
Joined: 10 Jun 2012
Total Posts: 841
22 Oct 2012 03:05 PM
@stealth

There is more than one framerate. On roblox the game's tick refresh rate is generally named the same as the rendering refresh rate.
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
22 Oct 2012 03:37 PM
wait(0) is the same as wait(), though it's supposed to simply wait one game tick. wait()/wait(0) in a local script can be changed by the player through their Roblox Studio settings. I'd suggest always filling in a number in your waits :)
Report Abuse
SourceLeak is not online. SourceLeak
Joined: 10 Jun 2012
Total Posts: 841
22 Oct 2012 03:41 PM
wait(0) actually does wait 0 seconds, wait() waits one game tick.

Waiting for one game tick is fine as it allows the game long enough time to process the requests without crashing.
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
22 Oct 2012 03:45 PM
No, Source. It's thought that wait(0) waits a single game tick, but it's the exact same as wait() if you test it.
Report Abuse
SourceLeak is not online. SourceLeak
Joined: 10 Jun 2012
Total Posts: 841
22 Oct 2012 03:49 PM
wait() IS a game tick. wait(0) is 0. 0 is not anything.
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
22 Oct 2012 04:01 PM
When you call the wait function, you wait. It's pretty simple if you ask me.
Report Abuse
1pie23 is not online. 1pie23
Joined: 11 Jul 2010
Total Posts: 1865
22 Oct 2012 04:03 PM
wait(0) == wait()

true

wait(0.0000000000000000000000000000000000000001) == wait()

true
Report Abuse
legalgohanss8 is not online. legalgohanss8
Joined: 23 Jul 2011
Total Posts: 89
26 Oct 2012 02:41 PM
@Source
while wait() do
end
Wouldn't work or at-least I don't think it would
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
26 Oct 2012 02:43 PM
Wow. This topic went from people who don't know what they're talking about to people who do know what they're talking about, and then it ended up as people who don't know what they're talking about.

while wait() do
end

Would indeed work.
Report Abuse
legalgohanss8 is not online. legalgohanss8
Joined: 23 Jul 2011
Total Posts: 89
26 Oct 2012 02:44 PM
@Source
Actually He is right wait(0) is a single game tick and it's the same thing as wait()
Either way you think about it it's the same thing trust me. They both make you wait the same amount of time.


~LIKE A BLOCK~ ~Check out my youtube channel: FallenAngelGaming
Report Abuse
legalgohanss8 is not online. legalgohanss8
Joined: 23 Jul 2011
Total Posts: 89
26 Oct 2012 02:46 PM
I didn't know that but like I said "I dont think it will work"



~LIKE A BLOCK~ ~Check out my youtube channel FallenAngelGaming
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
26 Oct 2012 03:31 PM
wait() = wait(settings().Lua.DefaultWaitTime)

However wait(0) is always one frame
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