Hello, Roblox
Part of the Roblox Game Scripting section of Coddy's Lua journey. Lesson 1 of 24.
Every Roblox game is made of parts (blocks, balls, platforms) and scripts that tell the parts what to do. Scripts are written in Luau, the programming language Roblox made from Lua.
The game on the right is a real world: a baseplate of grass, a spawn pad and a yellow sign. Press Play to run your script in it, and walk around with W A S D and Space.
The first thing every scripter learns is print. It writes a line to the Output panel under the game, with the time it happened in the game:
print("The game started")Text in quotes is a string. print also shows things that are not strings, like numbers and the names of parts. Every part in the world lives inside workspace, and you reach one by its name:
print(workspace.Baseplate.Name)That prints Baseplate. A script runs from the top line to the bottom line, once, when the game starts.
Challenge
EasyWrite your first Roblox script.
- Print exactly
Hello, Roblox! - On the next line, print the yellow sign's name by reading it from the part:
workspace.Sign.Name(not the text"Sign"typed in quotes).
Press Play to see your lines in Output, then press Check.
Try it yourself
-- This script runs once, when the game starts.
print("Hello")
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Roblox Game Scripting
2Loops and Functions
Row of PillarsStaircase BuilderTower BuilderCoin FactoryBlinking LightVanishing Bridge5Your First Game
Your First ObbyPractice on your own: Online Lua compiler