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: What kind of...

Previous Thread :: Next Thread 
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
04 Mar 2013 09:26 AM
What kind of loop would i use to make a thing always run, like for example:

LOOPKIND()
wait(300)
--stuff
end

Because i want a loop that will always run.I want to put waits inside the loop (and no while wait() is NOT included.Dont suggest that)
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
04 Mar 2013 09:48 AM
bumpy bear :D
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
04 Mar 2013 09:53 AM
function LOOPKIND()
while wait(300)
--stuff
end
end

LOOPKIND()
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
04 Mar 2013 09:54 AM
ops, this one is correct


function LOOPKIND()
while wait(300) do
--stuff
end
end
LOOPKIND()
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
04 Mar 2013 09:55 AM
bump (above, oyush i saw you)
Report Abuse
DifferentialCalculus is not online. DifferentialCalculus
Joined: 27 Feb 2013
Total Posts: 4
04 Mar 2013 10:03 AM
You're not supposed to bump after you got the answer.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
04 Mar 2013 10:24 AM
Neither of you red my thread.Bump ^ i could report that for spam :P
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
04 Mar 2013 10:51 AM
bump
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
04 Mar 2013 11:00 AM
Why can't we use while wait? o.o
Well there's also...

repeat wait()
until false

for Loop=1,math.huge do
wait()end

function Loop(id)
wait()Loop(id+1)end
Loop(1)

-- All of these loop forever. But um.. I'm not sure I get what you're asking.
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
04 Mar 2013 11:05 AM
Could i use repeat without until?
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
04 Mar 2013 11:06 AM
You can use repeat without until as much as you can use do without end. :P
(No, you can't.)
Why would you want to?
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
04 Mar 2013 11:06 AM
no
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
04 Mar 2013 11:15 AM
SDSJKFEMFSAJEMTHESKMYHJAS


What else can i use? (while wait cant run forever in what im asking) i dont want to set the seconds in while wait, i just need something to run forever.So i can set normal waits inside that.
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
04 Mar 2013 11:20 AM
is 'while true do' allowed then for you to use? That is the only one other I know about that not have any wait time
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
04 Mar 2013 11:21 AM
I think that crashes you.Anyway if i was to use while wait how would i make it run forever?
Report Abuse
DifferentialCalculus is not online. DifferentialCalculus
Joined: 27 Feb 2013
Total Posts: 4
04 Mar 2013 11:23 AM
What makes you think it doesn't run forever?
Report Abuse
cheatmaster18 is not online. cheatmaster18
Joined: 29 Oct 2010
Total Posts: 1871
04 Mar 2013 11:24 AM
yes, the only way to jump out of the loop is to use 'break' or 'return'
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
04 Mar 2013 11:26 AM
You want something like...

while(true)do
print("bla bla")
wait(5)
print("ble")
wait(5)
end

?
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
04 Mar 2013 11:35 AM
yeah, a script that runs forever and every 5 seconds it prints something, and it runs forever so... how to do that?
Report Abuse
DifferentialCalculus is not online. DifferentialCalculus
Joined: 27 Feb 2013
Total Posts: 4
04 Mar 2013 11:38 AM
You already got the answer, stop spamming.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
04 Mar 2013 11:53 AM
while true do
print("hi")
wait(5)
end

there
Report Abuse
Fedorakid is not online. Fedorakid
Joined: 17 Jul 2010
Total Posts: 7079
04 Mar 2013 12:19 PM
Different your a freaking idiot, stop spamming at my thread.@Miz i thought while true do would lag you??
Report Abuse
DifferentialCalculus is not online. DifferentialCalculus
Joined: 27 Feb 2013
Total Posts: 4
04 Mar 2013 12:47 PM
Can't tell if troll or stupid.
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
04 Mar 2013 12:57 PM
Oh, why not just end this madness.
I GUESS he's asking for something like .setTimeout in javascript.

---------------------------------------------------------------------------------

function loop(functionArgument, delayTime, ...)
while wait(delayTime) do
functionArgument(...)
end
end

---------------------------------------------------------------------------------

You use the function above like this:

function testFunction(mystring, mynumber, myinstance)
print(mystring)
print(mynumber)
print(myinstance)
end

loop(testFunction, 2, "hello, I'm a string!", 1337, workspace)

---------------------------------------------------------------------------------

You can add a coroutine to make it so code after your loop function will still run.





- As, while approval do print("Approved!") wait() end
Report Abuse
littleAU999 is not online. littleAU999
Joined: 15 Jan 2011
Total Posts: 1375
04 Mar 2013 01:04 PM
@allOfFedorasPosts,
*facepalm* *facedesk* *facewall* *facetrain* *faceceiling* *facefloor* *faceeverything*
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