How to detect when the player killed an enemy?

Hello, devforum.

I’m confused on how i would detect if the player had killed an enemy.

Can someone help me please?

Well, how does a player kill an enemy? Please provide us with more details to allow us to better help you.

1 Like

Well the player kills the enemy by stabbing it with a sword.

Well, does the sword create any tags that say who dealt damage and/or killed the player?

No not yet, that’s what im trying to do.

So, modify your sword’s script and have it create an ObjectValue which points to the player who dealt the damage and parent it to the enemy’s character. When a player has died (Humanoid.Died), check if there’s a tag. If so, now you have the player who killed them.

9 Likes