Learning language lua

i am beginner with scripting. i have all much time spend with read lua manual 5.1
clue what most important thing are to learn.my qeustion is what you learn as a beginner
scripter and qeustion two what are importants things to learn in scripting

1 Like

you should start off by getting familiar with tools and properties of objects.

1 Like

Agreed, Start with Basic Things like variables, Bools, Ints, and strings, Here are a few examples:

local Variable -- A Variable, used to Path for specify code
Dog = "Woof" -- String Variable (Holds words or characters)
Number = 11 -- Int Variable (-1,0,1)
TrueOrFalse = true -- Bool Variable (true or false)

Color3.fromRGB(255,255,255) -- White
Color3.fromRGB(0,0,0) -- Black
Color3.fromRGB(255,0,0) -- Red
Color3.fromRGB(0,255,0) -- Green
Color3.fromRGB(0,0,255) -- Blue

function Example() -- Function

Example() -- Calling the function

More info here:
Scripting Language:


Tutorials Page:

1 Like

what do you mean with tools and properties of objects i understand it a little bit

For example

workspace.Part1.Transparency = 1
workspace.Part1.SurfaceGui.TextLabel.Text = "hello world"

Though reading and tutorials is great, make sure you are spending enough time actually ‘doing’.
You get some really good experience just messing around trying things with code, and going through source code you find in the gears, or other posts.

Even if you don’t understand most of it, or really know what you are doing, that ‘experimental’ side to learning I think is often overlooked by beginners. Maybe they don’t want to ‘mess up’ anything, but sometimes you have to get a little messy.

Plus, were always here in the forums to help.

Start with the basics like manipulating the properties of a part for example. If you spawn in a part and add a script to it then you can use a variable to reference the part and then change the properties to your liking for example:

local Part = script.Parent -- The part is the parent of the script
Part.Color = Color3.fromRGB(255, 255, 255) -- White

Then slowly start getting more into it like using loops to make it change color, and maybe functions too. Then slowly you’ll naturally start looking for resources etc to get better.

1 Like

but is it good to read the lua manual 5.1

Depends, if you want to do more advanced things, i recommend reading the lua manual, but Roblox has certain functions that i recommend learning about if so.

1 Like

I would say no, not really. It’s very helpful if you have experience in another language, since it’s technical, but otherwise, you want to start from the basics.

Learn how the basic structures and datatypes are used:

Structures (in Lua, these are also interchangeable definitions of datatypes):

  • Variables
  • Functions
  • Tables/Arrays/Dictionaries


  • Numbers (No specific types like int or float; 0.0 is the same type as 1)
  • Strings ("these", 'are all', [[strings]])
  • nil (No value, equivalent to "null" in other languages)
  • Booleans (true / false) (reasonably self explanatory)
  • Functions (A structure, but also a datatype since Lua is dynamic. Represents a reusable block of code to be called later in the code)
  • userdata - Irrelevant (Is a Lua-to-C interface proxy)
  • Thread - Irrelevant (as a beginner, once you start getting into it, these will naturally come.)
  • Table (Another structure that is also a datatype. Contains [Key]: Value pairs, keys can be strings, numbers, or instances. Values can be whatever you wish, so long as it's relevant to Roblox/Lua)

After all those basic concepts, learn how its semantics work (i.e. How certain code in Lua relates to an English counterpart) as that will help guide you through understanding and actually reading Lua.

After that, you should have a fairly clear understanding. Reading Lua (somewhat) proficiently is the first step to writing it (somewhat) proficiently.

That’s all I can think of, glhf; it’s not an easy road.

Edit: Semantics example (forgot):
Say we have this message:

local MyMessage = "Hello, World!"

And we want to split it by the space.
We can do something like this:

local MyMessage = "Hello, World!"
local MessageParts = string.split(MyMessage, " ") -- string.split is a built-in string library function in Roblox's Luau version of Lua.
-- Print all our message parts
for Which, Part in pairs(MessageParts) do
  print(Which, Part)

Now, that’s a pretty simple script. But let’s convert it into English for semantics practice.

local MyMessage = "Hello, World!"

This is simple enough, a variable with a name defining a string for later use; let’s translate it!

I have a string, called MyMessage that says “Hello, World!”

That’s simple enough, right?
Let’s translate the next line:

local MessageParts = string.split(MyMessage, " ")

Bit more challenging, but still simple enough.

I call the split function of the string library with my string MyMessage as the first argument, and the character " ", which will return a table containing the strings on either side of that character. I want to take that returned table and put it in my new variable named MessageParts for later use.

That one is a lot more complicated, but it’s also verbose so that you can understand what the point is.
I’m not going to expand on the for loop, this post has honestly gotten long enough and I’m too tired to think that deeply about a Lua loop atm.

1 Like

Sorry for late reply, yes it is good to read the lua manual.
Even if you are not going to do much lua outside of Roblox, its good to have at least read over it once to have that basic understanding of the language.

Even if it seems difficult and you don’t quite understand, you can always re-read it later when you are more experienced.

As @dev4q said it’s best to just mess around with Roblox Studio and properties of objects and just get familiar of what you’re going to be working with before getting into scripting. And if you already know these things the important things to learn about scripting and the bare basics of scripting are learning how to debug code using print() and if statements/embedded if statements etc. while loops, for loops, tables, functions, return keyword. You can look these all up on
the Roblox API Reference Manual or on TheDevKing’s Beginner's Roblox Scripting Tutorial #1 - Roblox Studio Basics (Beginner to Pro 2019) - YouTube and check out some other tutorials too! Important note: whenever you learn something new always make something out of it, don’t let your knowledge collect dust as you’ll forget everything over a period of time. So lots of patience and practice helps.