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

How Do I Stop in my Code And Go to Another Line in the Code?

Asked by 1 year ago

So what I want is a point in my code where it goes from one line to another. For example,

I want it to go from line 15 to line one

If you can help thanks, if not, all good.

Thanks, Massimo

2 answers

Log in to vote
1
Answered by 1 year ago
Edited 1 year ago

The easiest way to do this would be to make a loop. At the top of you code put "while true do". This will loop the code. Put the end that is automatically added at the bottom, on line 17. This should look like: (im not bothered to go 15 lines down so just read the numbers)

1: while true do
2-16: your code
17: end
Ad
Log in to vote
0
Answered by
wf_sh 15
1 year ago

Goto statements are not supported in Luau. According to luau-lang.org/compatibility

"this complicates the compiler, makes control flow unstructured and doesn’t address a significant need"

Instead consider structured programming and the use of functions and iteration.

Answer this question