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
Coding Roblox Games Made Easy, Second Edition

You're reading from   Coding Roblox Games Made Easy, Second Edition Create, Publish, and Monetize your games on Roblox

Arrow left icon
Product type Paperback
Published in Jun 2022
Publisher Packt
ISBN-13 9781803234670
Length 302 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Zander Brumbaugh Zander Brumbaugh
Author Profile Icon Zander Brumbaugh
Zander Brumbaugh
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface Section I: Introduction to Roblox Development FREE CHAPTER
Introducing Roblox Development Knowing Your Work Environment Section II: Programming in Roblox
Introduction to Luau Roblox Programming Scenarios Creating an Obby Creating a Battle Royale Game Section III: The Logistics of Game Production
The Three Ms 50 Cool Things to Do on Roblox Worksheet Answers Other Books You May Enjoy
Index

Spawning loot

As in most battle royale games, players will start with a mediocre starting weapon and then begin looting around the map for better weapons. In this section, we will be creating a system that spawns weapons around the map for players to find and use.

Keep in mind that for this system, you should have several weapons designed using the weapon system we made previously; the more weapons there are to find, the more players will continue to look for them.

To start this system, add a new module titled Loot to the ServerHandler script. In this module, add the following code, which defines the services and other references we will need, as well as making the spawn parts hidden, anchored, and made so that you cannot collide with them. As you will see, we will need a new Folder called LootSpawns that will contain anchored Parts that weapons will spawn on. By default, weapon models will spawn one stud above the position of the Part itself, so keep this in mind when placing...

lock icon The rest of the chapter is locked
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 AU $24.99/month. Cancel anytime