Skip to content
Profile icon

Kevin Tomaszewski

@KevinTomaszewsk (1)
Repls
Posts
KevinTomaszewsk
KevinTomaszewsk
shared a Post
3 years ago
1
is there a way to "skip" lines of code in lua.
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
lolmhhh3
lolmhhh3 if boolean then break end 2 years ago
mat1
mat1 You can use an if statement to do this. In Lua, if statements are done like this: if(boolean_expression) then --[ statement(s) will execute if the boolean expression is true --] else --[ statement(s) will execute if the boolean expression is false --] end In your case, this would be like this: io.write('digits') qs = io.read() if(qs == 'q1') then print('this would print') else print('this wouldnt print') end Please upvote my comment if it was helpful or useful, thanks!3 years ago