How to get killer of a player

I’m trying to create a system that gives you coins when you kill a player with your knife. To do this I need to figure out who killed the player. I know that this has something to do with Humanoid.creator, but I don’t really know how to use it.

Basically, how do I make a player get coins whenever they kill a player.

You should have a handler for taking damage, if humanoid.Health -= damage is less than or equal to 0 then that is the person that killed them and mark it as handled via something like a bool value in char called “Dead” set to true so they cant be rewarded multiple times

1 Like

How i would set it up is by having a singular script in serverscriptservice which handles all tools that can deal damage etc, I recommend doing that as having to change the code for every single tool you have can become tedious if you want to add a lot of content to your game and then need to make a change, e.g say you wanted to add a NumberValue that indicates “X2 Currency” and since your damage and award scripts are multiple and in every tool what should take 40 seconds or less will take a lot longer to complete, and it makes the game less messy visually viewing in explorer.

1 Like