Kiepe | Mastering Roblox Coding | E-Book | www.sack.de
E-Book

E-Book, Englisch, 424 Seiten

Kiepe Mastering Roblox Coding

The unofficial guide to leveling up your Roblox scripting skills and building games using Luau programming
1. Auflage 2022
ISBN: 978-1-80181-444-7
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection

The unofficial guide to leveling up your Roblox scripting skills and building games using Luau programming

E-Book, Englisch, 424 Seiten

ISBN: 978-1-80181-444-7
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection



Roblox is a game platform with over 47 million daily active users. Something unique to Roblox is that you're playing games made by other gamers! This means that you can make your own games, even if you have no experience. In addition, Roblox provides a free engine that allows you to create and publish a simple game in less than five minutes and get paid while at it.
Most Roblox games require programming. This book starts with the basics of programming in Roblox Luau. Each chapter builds on the previous one, which eventually results in you mastering programming concepts in Lua. Next, the book teaches you complex technologies that you can implement in your game. Each concept is explained clearly and uses simple examples that show you how the technology is being used. This book contains additional exercises for you to experiment with the concepts you've learned. Using best practices, you will understand how to write and build complex systems such as databases, user input controls, and all device user interfaces. In addition, you will learn how to build an entire game from scratch.
By the end of this book, you will be able to program complex systems in Roblox from the ground up by learning how to write code using Luau and create optimized code.

Kiepe Mastering Roblox Coding jetzt bestellen!

Autoren/Hrsg.


Weitere Infos & Material


Table of Contents - Getting Up to Speed with Roblox and Lua Basics
- Writing Better Code
- Event-Based Programming
- Securing Your Game
- Optimizing Your Game
- Creating User Interfaces For All Devices
- Listening To User Input
- Building Data Stores
- Monetizing Your Game
- Creating Your Own Simulator Game


: Getting Up to Speed with Roblox and Luau Basics


In this chapter, we will start by looking at what Roblox is. Once we know this, we will learn about Roblox’s programming language. Then, we will proceed to understand the basics of this programming language, such as the data types and variables. We will learn how to perform unique operations on each of these data types, such as math operations. Once we know this, we can slowly increase the complexity of our scripts. We will then use conditionals to take our scripts to another level. Conditionals allow us to change the behavior of our code depending on data. Finally, we will learn all about scopes. We will learn what they are and why it is crucial to keep them in mind while coding.

The following topics are covered in this chapter:

  • Understanding Roblox and Luau
  • Understanding and using data types in Luau
  • Introducing variables
  • Using conditionals
  • Understanding scopes
  • Exercises

By the end of this chapter, you will have learned how to make scripts in Roblox. In addition, you will know how to make simple systems in your experience.

Technical requirements


To start programming with Luau, you need access to a device with internet access. This can either be a Windows or a Mac device.

You need to download the following software:

  • Roblox Player
  • Roblox Studio

To install Roblox Player and Roblox Studio, please follow the steps in the following article:

https://en.help.roblox.com/hc/en-us/articles/204473560

All the code examples for this book can be found on GitHub at https://github.com/PacktPublishing/Mastering-Roblox-Coding.

The CiA video for this chapter can be found at https://bit.ly/3ORIwT7.

Understanding Roblox and Luau


In this section, we will start by looking at what Roblox is and what makes it unique. Then, once we understand the fundamentals of Roblox, we will learn about the programming language that Roblox uses for its games.

Roblox is a really popular platform for children around the world. This is because they can play almost anything they want. With over 24 million different experiences, as Roblox likes to call their games, you can be almost anything. You can become a pirate, be the king of a castle, escape prison, or stop players from escaping. The possibilities are endless. And the best part is that it is completely free to play. According to Roblox, in September 2021, 47 million unique users played Roblox daily. Once you have created your account in a few clicks, you are ready to join an almost unlimited and constantly increasing supply of experiences.

Creating an account


To make an account on Roblox, visit this link:

https://www.roblox.com/signup

Roblox is unique because other players make all these experiences that you can join. Anyone that creates a Roblox account can create a game. Besides Roblox Player, which allows you to join experiences, there is an additional application called Roblox Studio. With it, you can create your very own experiences.

At the time of writing this book, there are over 9.5 million developers on the platform. These developers can unleash their creativity and make anything they want. Roblox also takes care of all the complex and technical tasks involved in hosting and maintaining games. All you have to focus on is creating the game. Roblox takes care of the rest. The platform ensures that your game shows up for your friends, and makes sure that you and your friends can join the game. They make sure that you can report people who misbehave and bans them from the platform. These systems, among many more, are provided by Roblox. If you make games using other game engines, these systems all have to be made and operated by you. This is pricey and very time-consuming.

However, this is not even the best thing that Roblox has to offer. You are also able to monetize the experiences! Roblox has a virtual currency called Robux. Players can purchase this with real-life money. When they convert their money into Robux, they can use it throughout the entire site to buy different things. This varies from purchasing clothing for your avatar to purchasing in-game perks for any game you like. When someone purchases something in your game, you get 70% of the sale. You can convert this earned Robux currency back to real-life money. This is called the Developer Exchange program. Some developers on the platform make over 1 million USD yearly!

Most of the time, these developers do not work alone. There is usually an entire team of developers that work on a game. These developers have different roles. The most common developers on a team are programmers and builders. However, other developer roles can be added if teams start to grow. In addition, other developer roles exist, such as animators, modelers, UI designers, music composers, and possibly even more. As previously stated, this book is about the programming aspect of Roblox. So, let us learn more about the programming language that is used to code Roblox experiences.

Introducing Luau


Roblox uses a programming language named Luau. Luau is an easy-to-learn yet powerful programming language. Luau is a heavily modified version of the programming language called Lua.

Because Roblox Luau has a relatively low learning curve compared to other programming languages, it is an ideal programming language to start with, especially for younger developers or aspiring developers. Even if you have no interest in creating experiences on Roblox, this is still a great starting point. In general, programming in any language teaches you how to think logically. This is useful even when you are not programming. By the end of this book, you will be able to analyze coding problems, split them into smaller tasks, and overcome them.

If you are hoping to program in other languages in the future, this is an excellent place to start. You might argue that if you know how to program in one programming language, you can program in all of them. This is because programming is basically instructing a computer on what to do. When nothing is specified, the computer does nothing. The only real difference between most programming languages is syntax. The syntax is basically what words you type in your script. Most programming languages use the same words. However, the syntax may differ.

Becoming a master in Roblox game development gives you a head start when programming in other languages. Regardless, before switching to another language, you first have to master Luau. It takes a lot of practice to understand everything in this programming language fully. This will most certainly be very stressful and confusing. Therefore, this book slowly progresses in complexity. A basic understanding of Roblox is highly recommended.

Roblox is a unique platform where people can play millions of experiences for free. The amazing thing about these experiences is that other users on the platform make them. 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.

In the next section, we make our very first Luau script.

Understanding and using data types in Luau


In this section, we will learn everything about data types in the Luau programming language. Let us start with the absolute basics. Programming is all about data. This data can be anything:

  • The player’s in-game money
  • The spot the player is in during a race
  • The number of criminals that they have arrested, or anything else

All of the mentioned examples are numbers. The in-game money can be 100, the race position can be 1, and the number of criminals arrested can be 3. In programming languages, we have numbers too. Numbers are our first data type.

Internal usage of the number data type

Sometimes, a difference between numbers and integers is made in the documentation. In Luau, integers are a part of the number data type. Internally, Luau changes between doubles, floats, and integers. If the documentation specifies an integer, you can expect the number to be stored as an integer internally. When a number is documented, it is internally stored as float or long. Do not worry if this does not make sense. This knowledge is not required in Luau.

We can have more than just numbers. We can also have sentences. Examples of sentences can be the player’s username, a roleplay name, or a chat message. These sentences are called strings in programming. Strings are our second data type.

You might have heard of our third data type, a Boolean. A Boolean is true or false. People often say programming is about ones and zeros, and true or false. There are no other possibilities for Booleans.

In the following sections, we will learn about all the things that we can do with these three data types. We will start by making a script to test out these data types.

Creating a script


Well, great to know about these three data types, but what can we do with them? Let us start Roblox Studio and follow these...


Kiepe Mark:

Mark Kiepe is an experienced Roblox Programmer and Game Designer with over six years of experience. He has contributed to a dozen of successful Roblox games. Besides that, he is the Co-Owner of a Roblox Game Studio called Sarcastic Studios with games such as Pet Store Tycoon and Dream Island. Mark has contributed to more than 150 million play sessions across all games at the time of writing. Mark started as a self-taught programmer on Roblox. What he learned on Roblox helped him in College. He currently attends a University of Applied Sciences in The Netherlands, where he studies Software Development.



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.