Introduction to Luau
Luau (opens in a new tab) (lowercase u, /ˈlu.aʊ/) is a fast, small, safe, gradually typed embeddable
scripting language derived from Lua.
What does that mean? I don't know either ¯\_(ツ)_/¯.
Luau is the language used to script Roblox games, if you're looking to learn scripting on Roblox, you're in the right place!
Luau is derived from Lua 5.1, if you're already experienced with Lua, you should be able to learn very quickly!
Getting started
Lets create a script and run it, you can choose between creating a script on Roblox, or by using Luau as a standalone executable.
Open Roblox Studio and create a baseplate.
You should have the Explorer, Properties and Output windows open. You can do this by going into the view tab and clicking on the Explorer, Properties and Output buttons.
Lets create a script within
ServerScriptService
. Hover overServerScriptService
until you see a little + appear. Then select Script from within the menu.You should see the script editor appear, if it does not appear, or you've accidentaly closed it, double-click on the script to open it again.
You should see the following code in the editor.
ServerScriptService.Scriptprint("Hello world!")
This script will start whenever you play the game.
You should see "Hello world!" appear in the output window.
Change the script to
ServerScriptService.Scriptprint("Hi!")
Press play again, the output should now be "Hi!".
Coding Challenge
Instead of printing "Hi!" make it print "Howdy!".
Howdy!