Write a simple Lua script that prints your name on the screen, learning basic coding ideas like strings, the print function, and running code.



Step-by-step guide to write a Lua script to print your name
Step 1
Open your web browser and go to an online Lua editor like repl.it or the Lua.org demo.
Step 2
Start a new Lua file or project in the editor.
Step 3
Click inside the code area so the cursor is ready to type.
Step 4
Type print("Your Name") and replace Your Name with the name you want the program to show.
Step 5
Save the file or give your project a name if the editor asks.
Step 6
Press the Run button in the editor to run your Lua script.
Step 7
Look at the output area and read the name your program printed.
Step 8
Change the text inside the quotes to a nickname or a different name.
Step 9
Press Run again to see the new name appear on the screen.
Step 10
Add a second line and type print("Hi! I'm Your Name") to make a friendly greeting.
Step 11
Run your program one more time to see both lines print.
Step 12
Share your finished Lua script and a screenshot or description of what it prints on DIY.org
Final steps
You're almost there! Complete all the steps, bring your creation to life, post it, and conquer the challenge!


Help!?
What can we use if we can't access repl.it or the Lua.org demo?
If you can't access repl.it or the Lua.org demo, install the Lua interpreter and run your file with the lua command or use another online IDE that supports Lua, then create a file, type print("Your Name"), save, and Run.
Why does my program show an error or nothing when I press Run?
If you get an error or no output after pressing Run, make sure you typed print("Your Name") with straight quotes and parentheses, selected Lua as the language in the editor, saved the file if the editor needs it, and checked the output/console area.
How can we adapt this activity for different ages?
For younger children, have an adult type and press Run while the child picks names, and for older kids, replace the hard-coded name with a variable and io.read() or add the second line print("Hi! I'm "..name) to practice input and string concatenation.
What's a fun way to extend or personalize the script before uploading a screenshot to DIY.org?
Personalize it by changing the text inside the quotes to a nickname, adding the second line print("Hi! I'm Your Name"), or modify the script to ask for a name with io.read() and then print a custom greeting so the output makes a neat screenshot for DIY.org.
Watch videos on how to write a Lua script to print your name
Facts about programming basics for kids
🔤 In Lua you can write strings with single or double quotes, e.g., print('Your Name') or print("Your Name").
🌙 Lua means "moon" in Portuguese — the language was created in Brazil!
🎮 Popular games and platforms like Roblox and World of Warcraft use Lua for scripting behaviors.
📝 The classic first program is "Hello, world!" — printing your name is the same fun first step.
🧑💻 Lua is tiny and fast: its core is only a few kilobytes, so it’s great for embedding in games and apps.


Only $6.99 after trial. No credit card required