Help with how to handle melee combat on client vs server

I’m making a combat system similar to the one in monster hunter games. I was thinking about handling the hit detection for moves on the client and sending info to the server to deal damage. I’d be doing this because the attacks rely heavily on the animation and trying to play animations from the server doesn’t work as well as playing them from the client. My main concern is how exactly to handle how much damage you’d actually be doing. When making an fps game you would have the info on the server which includes its damage so when you send the hit over and check if its legit the server knows how much damage the hit should deal. With the combat system I’m going for, each attack would have different attack values so I would either have to send the damage value to the server, which would allow exploiters to send whatever number, or I could send the attack ID through and have the attack info stored on the server so the server would know how much damage to deal, but then exploiters could just send through the attack Id with the highest damage. I’m not too good with making multiplayer games so I don’t really understand too well on when to rely on the client vs server. I’ve tried researching a bunch on the best way to handle stuff like this and how much exploiters can actually do but I couldn’t find much good info. If you have any info or If what I’m saying makes no sense and I just sound dumb please let me know I would greatly appreciate it :slight_smile:

1 Like

You can have separate “combos.” For example on the client you could do…

local combo = 1

function Activated()
   if combo == 1 then
      Animation1:Play()
      combo = 2
   elseif combo == 2 then
      Animation2:Play()
      combo = 1
   end
end

But note the only reason for the “combo” is to play the correct animation. Then you could do the same thing on the sever to see how much damage is needed.

2 Likes