Is there a way to track a players killer easily?

I been stumped on this, and was wondering, is there a way to track when a player dies, who their killer was. Instead of having to insert a new script in every custom gun or sword to track kills and log them?

Was just wondering since I been trying to make a custom Kill tracker which adds up all the kills in the game, but I’m not sure if there is an easy way to do this without having to hardcode every gun and sword indiv.

You could put that kill logging script in ServerScriptService and have all the weapons fire a remote event to it to let it handle all of them at once? There’s a lot that depends on the architecture of your game, I know things like the FE gun kit use a tag system and the server listens for a players’ death to see who had the most recent tag to award a kill to.