Creating weapons
You cannot have a Battle Royale game without having weapons. In this section, you will learn how to make a comprehensive and secure gun system that makes use of raycasting for hit detection.
To begin making the weapon system, start by adding a new module to the ServerHandler
script, named Weapons
. In this module, we will include the necessary services, variables, and other needed references. As you can see with the hitRemote
and replicateRemote
variables, we will need two RemoteEvent instances parented to ReplicatedStorage
, named Hit
and Replicate
respectively. These will be used so that the client and server can communicate with each other when necessary. Implement the following code block into your new module:
local playerService = game:GetService("Players") local replicatedStorage =Â Â Â Â game:GetService("ReplicatedStorage") local hitRemote = replicatedStorage.Hit local replicateRemote = replicatedStorage.Replicate local...