For my combat system I have 3 remotes but I’m focus on 2 right now, their called combatEvent and hitbox event. I have three modules (hitService: for stunned, knockback, damage, charTable: holding values and tables, combatHandler: for npcs and players, like tool activation, combos, blocking).
I fire the combatEvent to the server to check if it’s able to m1Combat, if able, I fire the event back to client. Play animation in the onClientEvent and when hits a animation event I create/destroy a hitbox and fire it to server. I verify the hit and send it back to client to do hit animations and vfx.
My problem is that i’m confused about npcs to use my combat system and npcs animation. I also have another problem of vfx as I have never coded vfx. Also I don’t know if I should do :FireAllClients to show hit animation and vfx to replicate to all clients.
For VFX you can check who has been hit using raycast for example and have a hit vfx particle played inside the character who has been hit via torso or humanoidrootpart.
Yes, :FireAllClients should be used for hit animations & vfx so there’s no delay for your client & other clients
NPC’s should be handled in the server because they don’t have their own clients to handle locally. You should make a seperate modulescript to handle npc actions and have a function for them to attack & so on, I made a combat system before using boolvalues (or you can use attributes) to check whether players and npcs are allowed to attack, block, or see if they’ve been hit and so on.
Handle the NPCS on the client if they have hitreg or such, to provide accurate results.
For actions that need seamlessness, like parrying, have the NPC be parried on the client that parried the NPC, a remote be sent to the server, the remote checks if the parry actually happened (if your checks are good then there shouldn’t be a problem), and the remote then replicates the parried animation to all clients. Movement should still be done on the server for accurate sanity checks though