Suggestions for Learning RBX.Lua?

Hello everyone! I’m BearByte (currently, name due to change soon). I’ve been playing Roblox for about 4 years now and I’m looking to start developing games. Although, I’m having some trouble understanding Roblox’s programming environment.

I’m fluent in Java & JavaScript and I know a bit of C++ and Python. I’ve went through the Roblox Wiki and the Roblox API-Reference, but I can’t wrap my head around it. Any suggestions on ways to get comfortable with RBX.Lua? Or any resources I could use to learn (books, videos, websites, etc.)?

Thanks! :smiley:

30 Likes

The Lua.org page has a lot of (if not all) the aspects of Lua covered, from loops, to OOP Concepts.

There are also a lot of youtube videos to help you out with different things if you are not a sit-and-read type of person. (Links down below :arrow_down: )

9 Likes

I myself am no programming master, but I think I can help a little.

I think one of the best ways to learn is to just play around. Over time and through trial and error you can get pretty good. Along with that, there are plenty of tutorials on YouTube if you want to learn about a certain subject.

Sorry if this is stuff you already know :stuck_out_tongue_winking_eye:

6 Likes

Definitely start by learning Lua by itself. Stop by lua.org and grab the binaries, start playing around with code, follow some tutorials online, read through Programming in Lua, check Roblox’s Intro to Scripting.

7 Likes

There are already several threads on this topic. Please search the DevForum first.

https://devforum.roblox.com/search?q=learn%20scripting%20category%3A55

6 Likes

Everyone learns differently so there may be different sources based on how you learn.

If you like to just jump right into it (like me) then you should look in the toolbox and find a bunch of free models. Dissect them, edit them, and run them. See what happens. Change random things and then try to create something new from copy and pasting code snippets from other free models. This is how I learned. I specifically looked at the viruses associated with free models and made my own :stuck_out_tongue_winking_eye: I obviously didn’t distribute the malicious scripts

If you’re more of a video person, check out the videos on the Roblox Developer Hub. These are super helpful and go over a variety of topics. There’s also some good channels for scripting on Youtube. You can just search up how to make a game and you’ll find a lot of channels.

As others are saying, look at lua.org as it does contain a lot of good references. Learning real Lua might help with Rbx Lua (even though I’ve never used real Lua so i don’t count).

3 Likes

The way I learn is by reading the documentation’s on the wiki. If you rather watch a video and replicate what the person is doing maybe take a look on my channel. There’s allot from small and easy to big and difficult My channel

2 Likes

Roblox can wait. Learn pure Lua first.
Use books. A lot of them. they are generally approved by experts in the fields making them more reliable.

3 Likes

I don’t know if I’d give the same suggestion. When you have the visual output on-screen rather than just text (i.e. “make this part red” as a way to learn how assignments work), it’s much easier to learn for most people. You’re going to be applying it in the context of Roblox anyway, so it makes sense to start working in Studio from the very beginning.

Disagree – a majority of the veteran scripters that are on the platform today learnt by doing and experimenting in Studio (and failing a lot).

OP already has background knowledge in programming in other languages, so the hub and a few simple tutorials / reference pages should suffice. No need to read entire books.

19 Likes

Since you already know how to program in other languages, you can apply the same ‘logic’ to roblox and use the API reference to figure out what to do.

i’d suggest that you think of a small project idea and think about how you could make it and use developer.roblox.com to learn how to do things with RBX.lua that you dont know.

but first learn basic lua syntax(it is quite similar to python)

2 Likes

RBX.Lua is the informal name of Roblox’s implementation of Lua 5.1.4. It is not its own language—it is ‘real Lua’. If you can program Roblox games, you can program in Lua. Learning Lua by itself will definitely help with using the language alongside the Roblox API.

Edit >2 years later: I was wrong about this. Roblox’s modification of Lua always excluded certain features like proper tail calls, making it its own modification of the language rather than implementation.

3 Likes

So, should I just program some stuff using the reference page as a guide?

3 Likes

I suggest you to check the learning sources here on devforum and some roblox lua tutorial on youtube! That’s where i learned rlua.

4 Likes

I would suggest that you watch lots of YouTube videos and just try coding things in studio.I would suggest that you watch @Alvin_Blox’s YouTube Channel. Another way that you can learn to code is by setting goals of what you want to make. For example you may think I want to make a simple loading screen, so you will keep researching and trying things out until you make one that works. This is a good way to lean because it will teach you how to overcome issues in the future and you will find you will lean a lot. If you are ever stuck on anything post it on this fourum and people will be able to help you with whatever issue you have. May I suggest you try and fix the problem yourself first as you will find you will learn more by doing it this way. Finally you can use the Developers Hub for API references and tuturials on various different things. This is only a good resoruce if you know what you are stuck on and you know what you want to learn how to do.

Tip: I would start with the basics of RBX.Lua even-though you know how to code in other languages.

7 Likes

a little out dated but peafactory has a beginners and advanced playlist for scripting

It’s where I started to learn, though I had 0 experience with scripting when I started

6 Likes

I recommend to use the wiki, youtube videos, or just go through trial and error. I am not a professional programmer but I keep using these things and I keep getting better. I sometimes watch a youtuber called Alvinblox he is a good scripter and good at teaching people new to scripting. I hope this helped you!

2 Likes

I think the methods you use to learn Lua really depend on the kind of person you are.

I, for example, could never learn Lua by literally reading pages of documentation and books because I would be bored out of my mind :stuck_out_tongue: However, that doesn’t mean reading documentation is the wrong approach - some people just learn better in that kind of environment, and I am not that people!

I much prefer experimenting with things, trying to make cool little games and by doing this I slowly learnt (still learning) and improved over time. When I first started out I used to take free models and look at the code inside and try to change what the scripts did. I personally have to be having fun to learn things, and so I just make whatever I feel like making - if I can’t make it I’ll research around, try and find that one useful API on the wiki or ask on the developer forum.

So, in conclusion, it really is personal preference. But if you don’t know where to start at all, why not try all the previous suggestions and future suggestion too?

Try and read lua.org.
Try to watch youtube videos.
Take a free model and change what it does completely.

Just keep trying and having fun - you’ll find what works for you in no time! :smiley:

5 Likes

I’m not programming master.

But I suggest you looking into Roblox Wiki, which helped me a lot, to understand some things.

Good luck with learning and with your future projects!

1 Like

It’s a fairly basic language. If you have a background in programming, you might be able to get away with reading the Lua reference manual for 5.1 (keeping in mind Roblox has killed the io library and neutered debug and os, and that the garbage collector can’t be manipulated in Roblox) for a basic knowledge on the grammar and syntax. Otherwise, you’re better off just trying to program something in Lua! The only way to improve is to try.

A big ‘gotcha’ of Lua is that indices start at 1 instead of 0 like in most other languages. That means the first byte of a string is at position 1, and the first index of a table is at 1. You should also be aware that all values in Lua are first class, meaning you can store them as variables. There’s also no difference between an array and a dictionary in Lua (they’re both tables).

5 Likes

All of these suggestions are great.

If you’re looking for sometimes dodgy but otherwise helpful scripts, open up the toolbox in studio, and insert some free models. You can take a look in scripts to help you better your understanding of how they work. This is how I started off.

Following this, you can look for specific bits on the wiki, to help you do very specialised things.

3 Likes