{}const=>[]async()letfn</>var
DevelopmentLua

🚀 Creating our first Lua script: from installation to launch

We'll figure out how to install Lua, where to write code and how to run your first script. A simple guide.

К

Kodik

Author

2 min read

Lua is an easy and simple programming language that is ideal for beginners. It is used in game development (for example, in Roblox), is embedded in applications and helps to quickly create scripts.

In this article, we will show you step by step how to set up the environment, write your first program and feel confident in your abilities 💪

📥 Step 1. Install Lua

🖥 For Windows:

  1. Go to the official website: https://lua.org

  2. Download the Windows build (for example, Lua for Windows)

  3. Install following the instructions

🍏 For macOS:

brew install lua

(pre-set Homebrew)

🐧 For Linux:

sudo apt install lua5.4

🔥 100,000+ students already with us

Tired of reading theory?
Time to code!

Kodik — an app where you learn to code through practice. AI mentor, interactive lessons, real projects.

🤖 AI 24/7
🎓 Certificates
💰 Free
🚀 Start learning
Joined today

🛠 Step 2. Where to write the code?

You can use any text editor. Here are a few simple options:

  • Replit - online, no need to install anything

  • VS Code + Lua extension

  • Sublime Text

Create a new file with the extension .lua, for example: hello.lua

✍️ Step 3. Write the first script

Insert the following code into the file:

print("Hi Lua!")

Save the file.

▶️ Step 4. Launch

If you are using a terminal:

lua hello.lua

If everything is configured correctly, you will see:

Привет, Lua!

Congratulations! 🎉 You have just written and launched your first Lua script!

🤔 What's next?

Now that everything is ready, you can start learning:

  • variables

  • terms (if)

  • cycles (while, for)

  • functions

  • tables (analogous to lists)

And to make it even more interesting, try the app Code . In it, you take a step-by-step course on Lua, solve problems, get achievements, and track your progress. Everything is simple and in Russian!

🎯Stop procrastinating

Liked the article?
Time to practice!

In Kodik, you don't just read — you write code immediately. Theory + practice = real skills.

Instant practice
🧠AI explains code
🏆Certificate

No registration • No card