Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Roblox Coding

You're reading from   Mastering Roblox Coding The unofficial guide to leveling up your Roblox scripting skills and building games using Luau programming

Arrow left icon
Product type Paperback
Published in Aug 2022
Publisher Packt
ISBN-13 9781801814041
Length 424 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Mark Kiepe Mark Kiepe
Author Profile Icon Mark Kiepe
Mark Kiepe
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Part 1: Start Programming with Roblox
2. Chapter 1: Getting Up to Speed with Roblox and Luau Basics FREE CHAPTER 3. Chapter 2: Writing Better Code 4. Chapter 3: Event-Based Programming 5. Part 2: Programming Advanced Systems
6. Chapter 4: Securing Your Game 7. Chapter 5: Optimizing Your Game 8. Chapter 6: Creating User Interfaces for All Devices 9. Chapter 7: Listening to User Input 10. Chapter 8: Building Data Stores 11. Chapter 9: Monetizing Your Game 12. Part 3: Creating Your Own Simulator Game
13. Chapter 10: Creating Your Own Simulator Game 14. Index 15. Other Books You May Enjoy

Summary

Roblox is a unique platform where people can play millions of games for free. The amazing thing about these experiences, as Roblox likes to call their games, is that other users make them on the platform. There are a lot of different roles that you can have as a developer on the platform. You can be a modeler, animator, graphics artist, and even a programmer.

Programmers on Roblox use a language called Luau. Programming is all about manipulating data to change something in the game. There are different data types in programming. The most common and essential data types are strings, numbers, and Booleans. These basic data types can make completely new data types, such as Color3 and Vector3. We learned how to use these data types and what purpose each has. We learned about how to do math operations on numbers, string concatenation, and relational operators using Booleans.

This data can be stored in variables. We learned how to update these variables. We saw that these variables are very similar to properties on instances such as parts. We learned that these properties are what make an instance unique. You can change these properties, and something changes. For example, if you change the color of a part using the Color3 data type, you will see the color of the part change.

Because not all data is the same, we can take different actions depending on the data provided. For this, we have conditionals. We saw how conditionals go hand-in-hand with Booleans. We learned that conditionals have something called expressions to determine whether certain data is what we are looking for. If this is the case, a particular scope gets executed. If this is not the case, we can choose to do nothing or execute another scope of code by using the elseif and else statements.

We learned that these scopes have all the data that all the scopes above them have. Furthermore, we saw how each scope can also make its own data. The scopes above it do not know about it. Only the scope itself and the nested scopes know about it.

In the first exercise, we also learned how to make visual changes in our game. We learned how references to instances in the game work and how to change the properties on these instances. Besides this, we also learned how to create a system based on a given system description.

In the next chapter, we will start improving the quality of our code. We will learn ways to minimize duplicate code and make more advanced systems using functions, tables, loops, and modules.

You have been reading a chapter from
Mastering Roblox Coding
Published in: Aug 2022
Publisher: Packt
ISBN-13: 9781801814041
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £16.99/month. Cancel anytime