Skip to content
← Back to Community
is there a way to "skip" lines of code in lua.
Profile icon
KevinTomaszewsk

for a little back story im trying to make a larger game in lua and want to add saving. since the version on repl is 1.5.x this means I can't do a goto command to skip a bunch of lines to go to say quest 43. is there any way that I can read a number from a line of digits, then skip to that number or a label that has said number in my code?

for example if goto existsed:
io.write('digits')
qs=io.read()
--lets say you type q1
goto q1
print("this wouldnt print")
::q1::
print("this would print")

Voters
Profile icon
KevinTomaszewsk
Comments
hotnewtop
Profile icon
lolmhhh3

if boolean then
break
end