Book Image

The Ultimate Roblox Game Building Cookbook

By : Taylor Field-Draper
Book Image

The Ultimate Roblox Game Building Cookbook

By: Taylor Field-Draper

Overview of this book

Roblox is a massively popular online gaming platform, but it can be challenging to maneuver for beginners who don’t know where to start, as well as seasoned developers who tend to struggle with limited scripting tools that make transitioning from other platforms such as Unity more difficult. The Ultimate Roblox Game Building Cookbook is an invaluable asset for any Roblox developer looking to take their skills to the next level. With a wide range of recipes, this Roblox book covers everything from the basics of game development on the platform to advanced techniques for creating immersive experiences. As you progress through the chapters, you'll gain a deep understanding of the proper workflow and building methods that will enable you to create extraordinary virtual worlds. You'll gain insights into creating complex game mechanics, such as multiplayer games, working with textures, and special effects in games. This cookbook will also provide you with tips from top Roblox developers, as well as valuable guidance on how to monetize your games and stay up to date with the latest trends in the Roblox development community. By the end of this book, you’ll have gained a comprehensive understanding of Roblox game development and design.
Table of Contents (13 chapters)

Building a functional TV

In this recipe, we will create a large flat-screen TV model that can be mounted on any flat surface. After building the TV model as a static prop, we will insert a script into the screen that will allow us to insert our own image IDs. These images will display on the TV and change every few seconds. To do so, we will learn how to modify the script to play to the parameters that we will set.

How to do it…

We will begin by scaling a square part to the size and shape of our TV and attach a wall mount to the back of it. Next, we will create a border around the TV for the screen to sit in. We will create a neon screen, and then adjust the bloom intensity of the material. To finish, we will color the TV and then insert a script, which we will customize with our own values. Let’s begin:

  1. To begin this recipe, insert a square part, then scale it 11, 6, 0.5 studs.
  2. Add a smaller square part into the center of the back face. This part will attach to the walls so that the TV can hang.
  3. Next, create a border around the edges of the TV using square parts roughly 0.75 studs thick. The border should be flush at the back and overhang the front of the TV by 0.25 studs:
Figure 1.13: Front and back view of TV

Figure 1.13: Front and back view of TV

  1. Duplicate the rectangular body part of the TV and move it forward 0.1 studs to create the screen of the TV.
  2. Change the material of the part we just placed to Neon.
  3. Rename the neon screen part Screen.
  4. Select the neon screen, open the color wheel, and select a color shade that is not overly intense, such as (159, 158, 161). You can see the difference in bloom in Figure 1.14:
Figure 1.14: Front and back view of TV

Figure 1.14: Front and back view of TV

  1. Next, add two small square or cylinder neon parts to the bottom-right corner of the front of the TV. These represent the power buttons.
  2. Select all the parts and group them into a model.
  3. Rename your model Prop_Tv.
  4. Now, color the parts within the TV model to (35, 35, 28).

    You now have a finished static TV prop. If you would like to add functionality to your TV, continue to step 12.

  5. Insert into the screen part. The script is located inside the Chapter 1 folder.
  6. Double-click inside of the screen part to open Script Editor.
  7. Paste in your own image IDs in the place of 999999, such as 9900113573, 13572778873, or 13544130736. imageID is a string of numbers found in the Texture box if you upload the image onto a decal.

    To learn how to find an image ID, check the There’s more… section at the end of this recipe.

  8. Modify the number inside the parentheses of wait(10.0). The number represents the amount of time it takes to change slides. You can now exit the script.
  9. Lastly, select all of the parts in the TV model and anchor them.

This completes the recipe on how to make both a static and functioning TV:

Figure 1.15: Completed functioning TV

Figure 1.15: Completed functioning TV

There’s more…

To find an image ID, navigate to Roblox Studio Toolbox and find the Free Image search option. Insert an image onto the face of a part, then double-click the decal to view its properties in the Properties menu. Copy the numbers at the end of the Texture link.