Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I send a script back to the beginning?

Asked by 10 years ago

I want basically the same effect as disabling and enabling the script, but done from one script. How do I do this?

2 answers

Log in to vote
1
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
10 years ago

Do your research.


What you're looking for is a loop. What type of loop depends on what your code is. To continuously repeat something, you should use a while loop. A while loop will repeat a block of code until the condition between the while and do keywords is false. If you give it a condition that will never, ever be false, it will loop forever.

In infinite loops, you must have at least a wait(0) somewhere in it, or the server will crash.

while true do
    wait()
    print("Spamming your output...")
end
Ad
Log in to vote
0
Answered by 10 years ago

This is not a request site, please try doing some personal research, or check out the wiki. Once you semi-find out what to do, and you get errors post them here and we will do our best to help.

0
Did you even read the question? This is not asking for a script at all. I am asking for a command, not some intricate script. If something like this does not exist then you could just say that, Google and the wiki both return nothing. Spectrabox 15 — 10y
0
_In this case_, his question is valid. He's asking how he should go about doing something lua-specific. User#2 0 — 10y

Answer this question