How to exit a Lua script’s execution? August 1, 2023 by Tarik Use os.exit() or just return from some “main” function if your script is embedded.