How would I get the player who damaged another player?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I need to know how to get the player who damaged another player.
  2. What is the issue? Include screenshots / videos if possible!
    I can’t seem to figure out how.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve tried using object values, but they don’t seem to work.
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
1 Like

You would use player tagging. Here’s a good tutorial on player tagging: How to Catch Combat Logging
(The person shows you how to do it, but it was for a different purpose. You can tweak it for your own use.)

3 Likes

Do you use a RemoteEvent to deal the damage? Also, do you want to keep track of the player that damaged another player till the damaged player dies, or do you wanna stop keeping track of the “damager” player instantly?

1 Like

I use a remote event to deal the damage, I am making a sort of counter script that teleports behind the player that damaged the local player.

1 Like

The first argument of OnServerEvent in RemoteEvent is the player instance.
This will be the player who executed the RemoteEvent, so first argument player instance is attacked player.

EDIT:

1 Like

I need to find who damaged the player

1 Like

I was wrong, it was an attacking player, not an attacked player.

Sorry for bad english

1 Like

You would track when the object that does the damaging touches a humanoid, then create a tag that is parented to the targets character.