Advertisement
KodingKid

How to use if, or, else, and elseif in Lua - Basic Scripting #40

Jul 9th, 2021
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.46 KB | None | 0 0
  1. a = io.read("*l")
  2. b = io.read("*l")
  3. c = io.read("*l")
  4. print("Please type 1 or 2")
  5. print("Please type 3 or 4")
  6. print("Please type 5 or 6")
  7. if a = "1" or "2"
  8.     print("Well done!")
  9.     end
  10. if b = "3" or "4"
  11.     print("Well done! Again...")
  12.     end
  13. if c = "5" or "6"
  14.     print("Well done! Again again lol...")
  15.     end
  16. elseif a
  17.     print("Try again...")
  18.     end
  19. elseif b
  20.     print("Try again...")
  21.     end
  22. elseif c
  23.     print("Try again...")
  24.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement