BETA
Kevin Tomaszewski
1
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
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