Answered Plainly

Learning Lua โ€” First Steps for Kids

Lua is a small, fast programming language. Its special talent is tucking inside bigger programs โ€” especially games โ€” and telling them what to do from the inside. Lua's words are few and plain, which is why so many people meet it early. Its own book, Programming in Lua, is published free on lua.org, and its very first program is one short line. You will run that exact line on this page.

Lots of kids first hear about Lua because of Roblox. There is a careful, true way to say that โ€” Roblox games are built with a language called Luau, which comes from Lua. This page explains that story in plain words, using Roblox's own Luau site as the source.

Pick your grade:

Elementary: The Little Language Inside Games

Lua is a guest inside other programs

Most languages build whole programs by themselves. Lua is different: it likes to live inside a bigger program, like a game, and run the game's moving parts โ€” when a door opens, when a player scores, when a character talks. Think of Lua as the game's inner voice, giving orders from inside.

One line is a whole program

Lua's book starts the way coders love to start: "To keep with tradition, our first program in Lua just prints 'Hello World'." The whole program is one line. When Lua runs it, the words Hello World appear. You will copy that exact line below.

Every piece of Lua code is a chunk

Lua's book has a fun word for any piece of Lua code: a chunk. "We call each piece of code that Lua executes, such as a file or a single line in interactive mode, a chunk." Your one line is a chunk. A whole game file is a chunk too.

Your First Lua Program

Do it with a grown-up (a grown-up needs to put Lua on the computer first โ€” it comes from lua.org):

1. Tap Copy the code below. Paste the line into a plain text editor. You can also select the code by hand and copy it that way.

2. Save the file with the name hello.lua โ€” the same name Lua's book uses.

3. Run it the book's way: lua hello.lua

Or start the Lua interpreter, wait for its > prompt, and type the line there.

print("Hello World")

What each part means

print: The name of the job โ€” "show these words."

The words in quotes: "Hello World" โ€” the exact words to show. The quotes tell Lua, "these are words, not orders."

The parentheses ( ): They hand the words to the print job.

That is the entire first program from chapter 1 of Programming in Lua. One line, and it is complete.

What You Should See

When the program runs, these words appear:

Hello World

If instead you see an error about a file that cannot be opened, the file name is the usual problem โ€” check that it is saved as hello.lua and that you are running the command in the same folder where the file lives. A grown-up can help with folders.

Where Kids Meet Lua: The Roblox Story

Roblox games are built in Roblox Studio, and the coding language inside Studio is called Luau. Here is what Roblox's own Luau site says, in its first lines: Luau is "a fast, small, safe, gradually typed embeddable scripting language derived from Lua 5.1," and it "is also integrated with Roblox Studio."

In plain words: Luau is Lua's close cousin, made by Roblox from Lua. It is not exactly Lua โ€” Roblox grew it from Lua and added its own extras. So the Lua you learn on this page is the same family. A Lua first line like print("Hello World") will look right at home when you meet Luau later.

Try Changing This

1. Change the words inside the quotes to your name: print("Hello, my name is Sam") โ€” use your own name. Save and run again.

2. Add a second line under the first, with a different message. Lua runs chunks top to bottom, so both messages print, in order.

3. In interactive mode, type a math question right at the prompt, the way Lua's book does: type math.pi / 4 and Lua prints the answer.

Words to Know

Lua: A small, fast programming language that tucks inside bigger programs and games.

Chunk: Lua's word for any piece of Lua code that gets run โ€” one line or a whole file.

Interpreter: The program that reads your code and follows its orders. Lua's interpreter is usually just named lua.

Function: A named job the language (or you) has set up. print is a function that shows words.

Luau: The language Roblox games are built with. It is derived from Lua โ€” Lua's cousin, made by Roblox for Roblox Studio.

Keep Exploring

This set of guides also has First Steps pages for Python, JavaScript, HTML & CSS, and Scratch, plus a cheat sheet of the top 10 programming languages for kids. Grown-ups who want every detail can read Lua's own book and Roblox's Luau lessons, listed below.

Sources

Lua: lua.org โ€” Programming in Lua (Roberto Ierusalimschy, Lua.org), chapter 1, "Getting Started," read in full: "To keep with tradition, our first program in Lua just prints 'Hello World'" โ€” the program is the single line print("Hello World"); running it with the stand-alone interpreter ("If you save the above program in a file hello.lua, the following command should run it: % lua hello.lua"); "We call each piece of code that Lua executes, such as a file or a single line in interactive mode, a chunk"; the factorial function example and interactive mode (typing math.pi / 4 at the prompt prints its value). Luau: https://luau.org/getting-started/ โ€” "An introduction to Luau," read in full: "Luau is a fast, small, safe, gradually typed embeddable scripting language derived from Lua 5.1... and is also integrated with Roblox Studio. Roblox developers should also visit our Creator Docs Luau Section." That page is the only Roblox source used here โ€” this guide says nothing about Roblox Studio steps beyond what it supports.

Checked against lua.org and luau.org on November 7, 2026.

Related guides: Top 10 Programming Languages, Learning HTML & CSS, Learning JavaScript, Learning Scratch and Long Division Steps.