Chapter 2: Writing Better Code
This chapter is all about using what we learned in the previous chapter and taking it to the next level. In this chapter, we will start by looking at functions. We will learn how and when to use them. Functions allow us to reduce the amount of duplicate code in our scripts. Once we have gained an understanding of this, we will then continue by looking at tables. Tables allow us to store a lot of data in just one variable. Once we have understood tables, we will start using loops. We will learn about all the different loops that Luau has. Besides that, we will use these loops in the tables that we make. Toward the end of the chapter, we will also explain modules. Modules allow us to write less duplicate code spread ...
Get Mastering Roblox Coding now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.