Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function confirmationPrompt()
- print("Do you want to continue? (y/n)")
- local input = read()
- if input == "y" then
- -- Your code for continuing goes here
- print("Continuing...")
- elseif input == "n" then
- print("Operation canceled.")
- else
- print("Invalid input. Please enter 'y' to continue or 'n' to cancel.")
- confirmationPrompt() -- Ask for input again
- end
- end
- confirmationPrompt() -- Call the function to start the prompt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement