How to end a script after it runs?
✓ ANSWER ACCEPTED
How to make a script end after the script runs?
2 answers
✓ Accepted answer
To end a script, just leave it. Or otherwise, if you don't want the script anymore after it's done doing its thing, delete the script itself.
To do this, write
script:Destroy()
on the script (replace 'script' with it's name).
'script' refers to itself and ':Destroy()' shows the action which is to destroy. So this means "destroy itself(script)"
Make sure to put it after the work on the script, or not it'll delete itself before the job ends.
You put an end, if it's loops or other stuff. otherwise leave it...
Example:
while wait() do --After I wait a litte while,
print("hi") --print hi
end --then end it.
This discussion is preserved as it was. New answers, comments, and votes are closed.
