Coding with Roblox Lua in 24 Hours: The Official Roblox Guide

Book description

Straight from Roblox: the easy, step-by-step, full-color introduction to building great games with Roblox

  • The only official beginner’s guide! Build your skills one step at a time, in 24 one-hour lessons

  • Covers all you need to know to get started fast — with all example projects available for download

  • Teaches through practical instructions, realistic examples, hands-on workshops, Q&As, quizzes, exercises, tips, and more

Table of contents

  1. Cover Page
  2. About This eBook
  3. Title Page
  4. Copyright Page
  5. Pearson’s Commitment to Diversity, Equity, and Inclusion
  6. Contents at a Glance
  7. Table of Contents
  8. About the Author
  9. We Want to Hear from You!
  10. Reader Services
  11. Hour 1. Coding Your First Project
    1. Installing Roblox Studio
    2. Let’s Take a Tour
    3. Opening the Output Window
    4. Writing Your First Script
    5. Error Messages
    6. Leaving Yourself Comments
    7. Summary
    8. Q&A
    9. Workshop
    10. Exercise
  12. Hour 2. Properties and Variables
    1. Object Hierarchy
    2. Keywords
    3. Properties
    4. Finding Properties and Data Types
    5. Creating Variables
    6. Changing the Color Property
    7. Instances
    8. Summary
    9. Q&A
    10. Workshop
    11. Exercises
  13. Hour 3. Creating and Using Functions
    1. Creating and Calling Functions
    2. Understanding Scope
    3. Using Events to Call Functions
    4. Understanding Order and Placement
    5. Summary
    6. Q&A
    7. Workshop
    8. Exercise
  14. Hour 4. Working with Parameters and Arguments
    1. Giving Functions Information to Use
    2. Working with Multiple Parameters and Arguments
    3. Returning Values from Functions
    4. Returning Multiple Values
    5. Returning Nil
    6. Dealing with Mismatched Arguments and Parameters
    7. Working with Anonymous Functions
    8. Summary
    9. Q&A
    10. Workshop
    11. Exercise
  15. Hour 5. Conditional Structures
    1. if/then Statements
    2. elseif
    3. Logical Operators
    4. else
    5. Summary
    6. Workshop
    7. Exercise
  16. Hour 6. Debouncing and Debugging
    1. Don’t Destroy, Debounce
    2. Figuring Out Where Things Go Wrong
    3. Summary
    4. Q&A
    5. Workshop
    6. Exercises
  17. Hour 7. while Loops
    1. Repeat Forever, while true do
    2. Some Things to Keep in Mind
    3. while Loops and Scope
    4. Summary
    5. Q&A
    6. Workshop
    7. Exercises
  18. Hour 8. for Loops
    1. How for Loops Work
    2. Nested Loops
    3. Breaking Out of Loops
    4. Summary
    5. Q&A
    6. Workshop
    7. Exercises
  19. Hour 9. Working with Arrays
    1. What Are Arrays?
    2. Adding Items Later
    3. Getting Information from a Specific Index
    4. Printing an Entire List with ipairs()
    5. Folders and ipairs()
    6. Finding a Value on the List and Printing the Index
    7. Removing Values from an Array
    8. Numeric for Loops and Arrays
    9. Summary
    10. Q&A
    11. Workshop
    12. Exercises
  20. Hour 10. Working with Dictionaries
    1. Intro to Dictionaries
    2. Adding and Removing from Dictionaries
    3. Removing Key-Value Pairs
    4. Working with Dictionaries and Pairs
    5. Returning Values from Tables
    6. Summary
    7. Q&A
    8. Workshop
    9. Exercise
  21. Hour 11. Client Versus Server
    1. Understanding the Client and the Server
    2. Working with GUIs
    3. Understanding RemoteFunctions
    4. Using RemoteFunctions
    5. Summary
    6. Q&A
    7. Workshop
    8. Exercises
  22. Hour 12. Remote Events: One-Way Communication
    1. Remote Events: A One-Way Street
    2. Communicating from the Server to All Clients
    3. Communicating from the Client to the Server
    4. Communicating from the Server to One Client
    5. Communicating from Client to Client
    6. Summary
    7. Workshop
    8. Exercise
  23. Hour 13. Using ModuleScripts
    1. Coding Things Just Once
    2. Placing ModuleScripts
    3. Understanding How ModuleScripts Work
    4. Naming ModuleScripts
    5. Adding Functions and Variables
    6. Understanding Scope in ModuleScripts
    7. Using Modules in Other Scripts
    8. Don’t Repeat Yourself
    9. Dealing in Abstractions
    10. Summary
    11. Q&A
    12. Workshop
    13. Exercise
  24. Hour 14. Coding in 3D World Space
    1. Understanding X, Y, and Z Coordinates
    2. Refining Placement with CFrame Coordinates
    3. Offsetting CFrames
    4. Adding Rotations to CFrames
    5. Working with Models
    6. Understanding World Coordinates and Local Object Coordinates
    7. Summary
    8. Workshop
    9. Exercise
  25. Hour 15. Smoothly Animating Objects
    1. Understanding Tweens
    2. Setting TweenInfo Parameters
    3. Chaining Tweens Together
    4. Summary
    5. Workshop
    6. Exercise
  26. Hour 16. Solving Problems with Algorithms
    1. Defining Algorithms
    2. Sorting an Array
    3. Sorting in Descending Order
    4. Sorting a Dictionary
    5. Sorting by Multiple Pieces of Information
    6. Summary
    7. Workshop
    8. Exercise
  27. Hour 17. Saving Data
    1. Enabling Data Stores
    2. Creating a Data Store
    3. Using Data in the Store
    4. Limiting the Number of Calls
    5. Protecting Your Data
    6. Saving Player Data
    7. Using UpdateAsync to Update a Data Store
    8. Summary
    9. Q&A
    10. Workshop
    11. Exercise
  28. Hour 18. Creating a Game Loop
    1. Setting Up Game Loops
    2. Working with BindableEvents
    3. Summary
    4. Q&A
    5. Workshop
    6. Exercise
  29. Hour 19. Monetization: One-Time Purchases
    1. Adding Passes to Your Experience
    2. Configuring the Pass
    3. Prompting In-Game Purchases
    4. Summary
    5. Q&A
    6. Workshop
    7. Exercise
  30. Hour 20. Object-Oriented Programming
    1. What Is OOP?
    2. Organizing Code and Projects
    3. Making a New Class
    4. Adding Class Properties
    5. Using Class Functions
    6. Summary
    7. Workshop
    8. Exercise
  31. Hour 21. Inheritance
    1. Setting Up Inheritance
    2. Inheriting Properties
    3. Working with Multiple Child Classes
    4. Inheriting Functions
    5. Understanding Polymorphism
    6. Calling Parent Functions
    7. Summary
    8. Workshop
    9. Exercise
  32. Hour 22. Raycasting
    1. Setting Up the Function to Raycast
    2. 3D Math Trick: Getting the Direction
    3. Setting Raycast Parameters
    4. 3D Math Trick: Limit Direction
    5. Summary
    6. Q&A
    7. Workshop
    8. Exercise
  33. Hour 23. Plopping Objects in an Experience: Part 1
    1. Setting Up the Object
    2. Creating a Plop Button
    3. Tracking Mouse Movements
    4. Previewing the Object
    5. Summary
    6. Q&A
    7. Workshop
    8. Exercise
  34. Hour 24. Plopping Objects in an Experience: Part 2
    1. Detecting Mouse Input
    2. Sending a Message to the Server
    3. Getting the Message
    4. Summary
    5. Q&A
    6. Workshop
    7. Exercise
  35. Appendix A. Roblox Basics
    1. Keywords
    2. DataType Index
    3. Operators
    4. Naming Conventions
    5. Animation Easing
    6. Possible Solutions to Exercises
  36. Index
  37. Code Snippets

Product information

  • Title: Coding with Roblox Lua in 24 Hours: The Official Roblox Guide
  • Author(s): Official Roblox Books
  • Release date: December 2021
  • Publisher(s): Sams
  • ISBN: 9780136829515