Coder Social home page Coder Social logo

coding-roblox-games-made-easy-2nd-edition's Introduction

Coding-Roblox-Games-Made-Easy-2nd-Edition

Coding Roblox Games Made Easy - 2nd Edition, Published by Packt

Book Name

This is the code repository for Coding-Roblox-Games-Made-Easy-2nd-Edition, published by Packt.

The ultimate guide to creating games with Roblox Studio and Luau programming

What is this book about?

Roblox is a huge entertainment platform like no other for both playing and creating games. With over 200 million monthly active users, Roblox has enabled new and experienced developers to create successful games, often called experiences, that can be played globally at no cost.

Coding Roblox Games Made Easy, 2nd Edition, builds a solid foundation of the concepts you need to embark on the journey of building two end-to-end games in Roblox in increasing order of complexity.

For the first game, you will create obstacles and traps for an obstacle course game (obby) and overcome them to win the game alongside other players and earn rewards. In the next game, you will manage player avatars, their weapons, a battlefield and add programming logic for the players to find their weapons and fight, with a reward for the last player standing.

Finally, you'll delve into the logistics of game production, focusing on optimizing your games' performance by implementing impressive mechanics, monetization, and marketing practices. We will also discuss how the Metaverse is set to change the dynamics of user experience and what the future holds for Roblox game developers.

Let's create and share experiences through play!

This book covers the following exciting features:

  • Understand how to use Roblox Studio and other free resources
  • Learn how to code in Luau: basics, game systems, physics manipulation, etc.
  • Test, evaluate, and redesign to create bug-free and engaging games
  • Use Roblox programming and rewards to make your first game
  • Move from a lobby to a battleground, build avatars and create weapons with which to fight
  • Master the three Ms: Mechanics, Monetization, Marketing
  • Learn 50 cool things to do on Roblox

If you feel this book is for you, get your copy today!

Instructions and Navigations

All of the code is organized into folders. For example, Chapter03.

The code will look like the following:

local myBool = true
myBool = not myBool
print(myBool)

Following is what you need for this book: This Roblox book is for anyone who is interested in learning how to develop games on the Roblox platform or those already familiar with Roblox who want to explore the best tips, tricks, and Roblox and Lua practices for efficient development.

With the following software and hardware list you can run all code files present in the book (Chapter 1-8).

Software and Hardware List

Chapter Software required OS required
1-8 Roblox Studio Windows, Mac OS X, and Linux (Any)

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.

Get to Know the Author

Zander Brumbaugh is an independent programmer, project manager, and game designer. The games he has made or contributed to have been played more than 300 million times. He has created popular games including Anime Lifting Simulator, My Salon, Munching Masters, Power Simulator amongst others. Zander currently attends the University of Washington and is part of the Paul G. Allen School of Computer Science and Engineering. At the time of writing, Zander is 19 years old.

Community & Support

Join the book Discord Server to participate in the ongoing discussions or/and initiate a new one. You will find other developers reading the book alongside and helping each other with questions.

Download a free PDF

If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

https://packt.link/free-ebook/9781803234670

coding-roblox-games-made-easy-2nd-edition's People

Contributors

meenakshivijay avatar msktejas avatar packt-itservice avatar packtutkarshr avatar zanderbrumbaugh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

coding-roblox-games-made-easy-2nd-edition's Issues

Fix for Coding Roblox Games Made Easy 2nd Ed

I've been following Zander's code for creating an obby very closely (Chapter 5). I ran into an issue that I've finally resolved using ChatGPT. The problem was that when Get Function of the Data module code ran (see p.127 of the book and his code example on GitHub):

--Get Function dataMod.get = function(player, stat) local key = player.UserId return sessionData[key][stat] end

It was giving this error:

ServerScriptService.ServerHandler.Data:119: attempt to index nil with 'Stage' - Server - Data:119

I narrowed it down to the Initialise module in this section of code on p.141 of his book:

`playerService.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
player:WaitForChild("HumanoidRootPart")
local stageNum = dataMod.get(player, "Stage")
local spawnPoint = getStage(stageNum)
char:SetPrimaryPartCFrame(spawnPoint.CFrame * CFrame.new(0,3,0))
end)
end)

return initializeMod`

The problem is, my obby is already quite complex. So the HumanoidRootPart was taking too long to load and therefore, no previously saved stage value (eg Stage 15) could be retrieved but the player would default to stage 1. However, if I fell off and died, the player would then be moved to the correct stage (eg Stage 15). This is because the HumanoidRootPart was properly loaded by then.

ChatGPT took a few goes at analysing the code then when I narrowed it down to that section, it suggested the following alteration which works (Note: I made slight variable name changes for my own game and we use "s" instead of "z" in Australia for "initialise"):

`playerService.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)

	local humanoidRootPart

	repeat
		humanoidRootPart = char:FindFirstChild("HumanoidRootPart")
		wait()
	until humanoidRootPart

	local stageNum = dataMod.get(player, "Stage")
	print(stageNum)

	local checkpoint = getStage(stageNum)
	print(checkpoint)
	--char:MoveTo(checkpoint.Position)
	char:SetPrimaryPartCFrame(checkpoint.CFrame * CFrame.new(0,3,0))
end)

end)

return initialiseMod`

It uses a Repeat Until loop to force the code to wait for the HumanoidRootPart to spawn. Then the code continues and correctly assigns the saved stage to the player instead of the default stage.

So now it works!

I hope this helps others who may have run into the same issue. And I hope the final version of this has correctly formatted the code because the preview did not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.