How to start learning luau?

Hello,

I’d like to ask: what is the best and most effective way to start learning Luau in order to become a skilled scripter on Roblox?

I’ve already watched several tutorials on YouTube and have some experience scripting basic systems. However, I want to take my skills further and learn how to study Luau properly.

Could a more experienced scripter share advice on the best way to practice, and where to start so I don’t miss any important fundamentals?

Thank you! (I’ll take all your comments into consideration)

14 Likes

i dont like tutorials and stuff like that cuz they often teach bad scripting practice so its easier to teach an example but its worse in the long run.
resources i recommned for Luau:

  1. creator docs: Documentation - Roblox Creator Hub
  2. Best Practices for Clean Code · GitHub
  3. code samples (official roblox examples of clean, strictly-typed code): Code samples | Documentation - Roblox Creator Hub
  4. lua reference manual: Lua 5.1 Reference Manual - contents
  5. Roblox OSS Discord - Code of Conduct / Suphi Kaner’s Discord Server (servers for asking questions)
  6. Roblox Development Script Architecture | by James Onnen (Quenty) | Roblox Development | Medium
  7. Plant reference project | Documentation - Roblox Creator Hub (some of the stuff here is a little complex so its prob better to read this once more experienced)
21 Likes

If you don’t know the fundamentals go watch the dev king series, he can set you up well he has advanced and beginner playlists. After watching some of his videos and having a slight idea on how to make what your trying to make then start your own journey. Look at the documentation and figure stuff out man.

This is how I started: fundamentals then kicked off the Dev King support and figured out everything using documentation and already existing DevForum posts.

4 Likes

In order to really get good at Luau, above everything everyone’s going to tell you here, the very first thing you’ll ever need is a reason to learn it. Without it, your motivation will quickly die and you’ll end up back at square one again.

Next: as others have mentioned, master the fundamentals. They aren’t just exclusive to Luau (mostly). See how logic gates work, what certain functions do… try recognizing some patterns.

One thing I’d highly recommend is actually using AI in case you have any questions. In most cases, it’ll help you absorb certain concepts fast with catered explanations.

HOWEVER… do not use AI as a replacement to code for you by copy-pasting material. You’ll never advance that way. And there’s a pretty good chance that if you don’t know what your code is doing, your script probably won’t work the way you expect it to.

In order to keep yourself motivated, instead of completing generic tutorials, try working on small projects with challenges that are just beyond your capabilities. If you don’t know something, research it. Try and connect the puzzle pieces if you know what I mean.

Good luck on your scripting journey!

12 Likes

Honestly it’s mostly just practice. Lua is a relatively simple language so as long as you know the true basics, you’ll encounter the more advanced stuff in time. The other posts cover most aspects, but personally I’ve found reading and responding to scripting questions on the devforum was invaluable for my learning since it showed me a lot of ways others solved problems and gave me problems to think about that have helped me in often indirect ways later.

2 Likes

I think the best way is either dev forum or testing code from dev forum

for example, learning for loops. You can either learn what it does or test the code

— code because I forgot how to insert it as code or maybe I’m just on phone
for count = 1, 100, do
print(count)
end

and to learn about pairs() you can try

local table = {1,2,3,”no”} — makes variable

—code
for i, v in ipairs(table) do
print(i,v)
end

The reason running code from dev forum will work is because it’s made to help you understand how it works

As long as it has something to print…

But if it doesn’t have any print or anything to output, it’s prob better to read what it does

This is how I learned lua

1 Like

Yes. It is true that it won’t work like expected. But if you be specific enough, there’s a chance it will work.

while yes, it won’t make you advance, the ai CAN teach you something in their code using the — messaging.

While You can also ask the ai what certain things do to get a little understanding of the code, you won’t learn anything if you’re just pasting code.

So still, the best way to master Lua isn’t just to paste scripts, but to also learn from them if you can.

You can use ai to help you code if you’re new. But if you want to learn lua, you can try learning from the dev forum or the Roblox coding documents which will appear as blue underlined text when you type certain things in code like

pcall() which can be used to get errors as string if something goes wrong

1 Like

I agree with this. The easiest way is to attempt to create a game, find issues in your game, and fix them. The devforum is your best resource. Almost all youtube tutorials are completely useless unless you already have a basic understanding. Since you were able to create this topic in the first place, that means you have been active on the devforum for a while which is a great starting place.

My first post on the devforum was about creating a particle emitter with a changing hue and was pretty dumb because I could’ve just used the roblox docs, another extremely useful resource.

Basically, the steps I would recommend are:

  1. Think of a game idea (doesn’t have to be a good game idea; could just be a copy of another game)
  2. Attempt to create that game
  3. Fail multiple times and learn by asking/searching for help on the devforum or using the roblox docs
  4. (Optional) Look at new posts on the devforum and try to solve the problems yourself
2 Likes

Thank you! I think I’m motivated enough. I want to make Roblox development my main job. Honestly, I dislike most regular jobs, but I truly enjoy creating on Roblox. As you probably know, you can earn a lot if your game becomes successful and goes viral - like “Grow a Garden”, “Blade Ball”, “Bee Swarm Simulator”, and many others.

I want to learn scripting because it’s fascinating to see what happens once your script is complete. If I don’t succeed in that, I’ll try something else like VFX or SFX. But honestly, I don’t think I’ll fail - I’m determined to make it work. I might have some difficulties with complex systems that require advanced math. I only know the basics of mathematics. But still, I don’t think it’s a big problem. I believe it’s possible to get started without advanced math at first. While I’m learning Lua, I’m also going to study maths maybe.

One popular dev told me that “The thing about programming or any other skill - is that you won’t get good at it unless you give it 100%”.

Maybe you could suggest some tasks to help me practice my skills? I’m currently thinking of trying to create a house with furniture, making it fully functional, and implementing a sack system like in Dead Rails. Thanks !

For something like a sack system you should also consider learning general programming principles like data structures.

The sack system in dead rails operates like a stack, the data of object is stored like a plates stacking on top of each other and hence so is what is outputted as well.

If you read as much as possible you will have more tools which you can use to solve a problem like dead rails.

I studied AP computer science so I know some algorithms like bubble sort, not all of em you can use as in roblox it’s done for you as you just use the table.sort function so studying is kind of counterintuitive. The best way might not be the most effective and time efficient way.

Roblox also has a module for that.

3 Likes

hayy, how I learnt luau was like this

I used videos to learn ABSOLUTE fundementals, but it came easier since I’ve always loved coding all my life.

A computer speaks a language too, and it’s quite far from english. it looks like this

01010011100101

but luau and other languages make it more like english. EG.
some 1s and 0s get turned into

if hasMilk == true then
DrinkMilk()
end

or you go to the kitchen to pick up some noodles?

local function PickSpaghetti()
local hand = game.Players.LocalPlayer.Character["Right Hand"]

hand.Position = Vector3.new(hand.Position.X, hand.Position.Y - 5, hand.Position.Z)

return hand.Position
end

and if you don’t know these things, you’ll have to start from scratch. Literally. Y’know that orange cat that taught you in primary/elementary? He will help you learn basics if you are REALLY stuck on it. Try making a game close to what you want to make, then transfer those skills to luau.

tl;dr

  1. Understand fundemental logic, think in computer, not english. maybe even think about everything you are doing IRL in code, everyone’s different
  2. Learn some ABSOLUTE BASICS with tutorials, but that’s as far as they will take you if you want to truly understand
  3. Read the devforum and documentation. wanna know how raycasting works? Look no further, it’s all here.
  4. MASTER IT
2 Likes

By the way, I wanted to ask — is logical thinking really that important for scripting? Because I do have everyday logical thinking, maybe it’s average, but not perfect. But as soon as it comes to scripting, it feels like that everyday logical thinking doesn’t help, since it’s a completely different field.

Logical thinking is a pretty general area I believe you are confusing it with breadth vs depth.

The thing about learning is that you need to maximize and balance both breadth and depth.

If it is a different field then you are probably missing breadth and you are trying to specialize too soon like going all in on A star pathfinding while forgetting about datastores and projectile motion. They both fall under logical thinking it is just the knowledge itself is different.

1 Like

couldnt agree more [spoiler] [/spoiler] [spoiler] [/spoiler]

2 Likes

It helps a lot. Some people when faced with a bug will quit. Logical people will troubleshoot with prints to see where it is working, look at errors in the console, BECOME THE COMPUTER and realise that they said

Vector3(0,0,0)

instead of

Vector3.new(0,0,0)

(actually happened to me many times)

BUT logical thinking is automatically learnt as you wrap your head around coding, and is more for advanced coding vs initial coding

1 Like

OH AND REALLY IMPORTANT.

You learn NOTHING and I mean NOTHING from copy pasting or mindlessly typing a coding tutorial.

You’ve gotta try to understand what everything does. I recommend looking on roblox documentation if you don’t know what something does.

Learn
Understand
Consolidate
Copy

Try make a game within your skills. First maybe try make your own killbrick, it will give you knowledge about how the player has a humanoid that manages the damage and stuff. Or maybe try make a script to detect when the player presses Q, teaching you about user input service.

And future gamedev, welcome to our community, but I recommend getting started now that all of these lovely people have given you advice. If you have questions, feel free to ask anyone in the devforum, they are happy to help

2 Likes

Thanks for the answer! I already know how to make a kill brick and some other simple things like working GUIs, UserInputService, prompts, RemoteEvents, DataStores, etc. I hope I succeed and start understanding scripting much better, while also improving my logical thinking through Roblox development. I seem to know the basics, but for some reason, I still don’t understand how to create more complex systems, beyond simple NPCs with quests, GUIs, and similar things.

What do you want to make? Because quite honestly create a post, make it clear that you are new and want an explanation of what it does.

Just don’t ask people to design entire systems or very big code, just ask how to do it and some snippets, and they will help you until you completed it

PS. I thought you were new, like new new. Like you only just learnt what script.Parent.Transparency = 1 does new