From my experience of looking at battlegrounds games, there are a couple of things I see that you would most likely need.
Hitboxes
First off, a good working hitbox system, as everything evolves around attacking people, having good hitboxes can be a game changer. Ways of making a hitbox system, you could use Raycasts
, but for the love of potatos do NOT use any .Touched
events I beg 
I would recommend using workspace:GetPartsBoundInBox()
or the other variants of that function, as they are very useful for melee combat, explosions, aoe attacks, and more.
Said hitbox system would also require the ability to deal with people who are on lower ping, as otherwise the difference in ping could harm the combat loads. I dont know how exactly you’d program this part in, but when you get to that step, Im sure members here on the devforum would love to help!
Blocking
Most bg games I’ve seen have well, blocking, of which shouldnt be that hard to do.
All you would need to do is send an event to the server and tell it, hey, block! And then send an event to the server when you stop blocking so it well, stops blocking.
Blocking is one of the things that needs to be handled via the server, well just the logic of it.
Now lets say you use an attack that doesnt ignore block, in that case you’d have to check if the target
is blocking, if so you need to check if you are Infront of the target.
You can use a hitbox for that part, by just putting one where the targets
block protects themself, and if the attack is in that area, then you block it or smth like that.
Characters
Battlegrounds games consist of lots of different characters, so organizing all of that can be difficult, thats why I recommend the use of modules, as they are SO useful for this sort of thing.
What I would do when a player selects a character is relatively simple.
Once they select a character, you would give them a Tool (aka the roblox tool instance)
, with it corresponding to an attack that the character has.
PS make sure that the RequiresHandle
property is off
When the player activates the Tool (Tool.Activated
), you would send a remote function to the server telling it to do the corresponding attack.
The remote function would then return a boolean that determines whether or not the player can actually do the attack, in which case they can, the client plays an animation for the attack.
the RemoteFunction would also return a number, which would correspond to the cooldown of the ability, of which on the client, and server, you wouldnt allow the move to be used again until the cooldown time has passed.
As for how to actually create attacks, those consist of things I cant exactly explain, you’d just have to try and code them, but they would require the hitbox system, VFX, animations, and Im sure there are other things.
Overall this if just an example of how you’d go abou it, if you have any questions regarding this, feel free to ask, as I’d love to help you out!
:]