How would I detect what a player died by?

I’m making a game with bombs. And I want to get the bomb’s explosion that killed the player and where the explosion is located. How would I do this?

In a LocalScript, you can listen for the Humanoid.Died event. Most likely you would have to use a RemoteEvent to fire for the server, of course in ReplicatedStorage, to set off the event for the server.

Are you using an Explosion for your bombs?

Because if so, there’s a Explosion.Hit event they have.

You could do all sorts of fancy things with that.

when applying a damage to a player store something in the player what damage it
and when it dies use that to determine what killed the player