Local replication
Local replication is a term used to describe the process of a client sending a signal to the server, which in turn is sent to other clients to replicate different occurrences with the benefits of local behaviors. For example, if a client generated a projectile visualizer locally, nobody but that player would be able to see it. If the visualizer were on the server it would be subject to the latency and lower refresh rate of the server, causing janky visuals. When a client wanting to replicate an effect sends the needed information to the server so that the effect may be generated for a different user by their own client, then you can maintain accurate and virtually lossless visuals.
To do this, we will need to create a new OnServerEvent
event function for the Replicate
RemoteEvent in ReplicatedStorage
. This should already be defined from when you created the Weapons
module earlier. The parameters of this event function are the player who fired the remote, the weapon...