Handling abilities/effects and hitboxes on client and server

So I plan on creating an ability system for the first time with the effects and hitboxes on the client and have the server handle the verification of the hitboxes and damage. I have seperate modulescripts for each ability/effect such as a death effect like so

646c550ec898b49ffaa15f0eecdb2529

Currently i have a simple attack system that works like this

  1. Client takes in input, plays animation for instant feedback while turning on the hitbox for the attack
  2. Server recieves event when the client claims that it “hit” something, does some sanity checks like is it through a wall, was the animation that played the correct one, is it close enough to the player, or basically if the hit makes sense.
  3. If it does make sense it’ll handle damage on the server and fire to all clients if necessary to run certain effects
  4. Client recieves the command to run these effects and plays them so the server doesn’t have to replicate them and take the load off the server

Is there any point in having them in like serverscriptservice or replicated storage? currently i have them stored inside the main client’s script and since i have no plans on playing the effects on the server and instead do it on the client. would this be plausible?

snip

Are there also better ways to handle/check hitboxes? like could i check with proximity/closest point if its a raycast hit detection or replicate the hitbox on the server if it was region3 for a bit?

5 Likes