How do I make it give kills to the killer?

Hello, I have a system where when you get shot by guns at health like 20 or 25 you become wounded you either have to click give up or wait for medic but the problem is when you click give up the killer doesn’t get any kill and I have no absolute idea how I can find the killer so I can send it to remote event… to give kill to the killer so anyone have any idea?

game.ReplicatedStorage.Events.GiveUP.OnServerEvent:Connect(function(player)
	--local Object = Instance.new("ObjectValue", player.Character.Humanoid)
	--Object.Value = Killer is unknown and I need a way to find him..

	player.Character.Humanoid.Health = 0
end)
1 Like

I assume that finding the killer in the first place is the main issue here if I am correct. Perhaps you can store the last enemy player to have damaged the player who gives up.

1 Like

Yeah that is the main issue, but um how I am going to store last enemy played that damaged, by the gun scripts?

1 Like

I will need more context to help you further (your code).

1 Like

There’s a lot of solutions, you can either make a Damage Module or do the tagging method to check who killed who.

Maybe this can help

2 Likes

But the player is not killed yet means there is no tags, the tags goes in humanoid only when player is killed

1 Like

Can you tell me which code you need to see?

1 Like

you put the tag whenever you damage the player, then remove the tag every 0.1 or 0.3 second

if Character:FindFirstChild("Tag") then
print(Character.Tag.Value .. "Is the Killer")
end
end)
1 Like

Wouldn’t that make lag? the server max players for game is like 70 player

well you can always make an module that handles damage

Module(Player, Enemy)

---Lets say this is the module
Enemy.Character.Humanoid.Health = 0
print(Enemy.Name .. " Was Killed By " .. Player.Name)
1 Like

This is close to the thing you want to do

You get points from Wounded and Killed

You can find out which player hit the other player before the Wounded player dies

An example of this in the video is that points are awarded to a player when the other player is injured, immediately before the death of the injured player, and other points are calculated upon the death of the injured player.

A distinction can be made between someone who hit the other player and someone who killed the other player

2 Likes

Thanks bro, I appreciate your help but um I fixed it by making object values into humanoid when player is wounded and it give kills when player click give up button instead of waiting for medic.

1 Like