Earn Bounty for Killing a Player

How would I make a script that where a player kills another player they earn a percentage of the player’s bounty they kill. The player who died also loses a percent of the player they lost

I have tried looking at tutorials, other sources on devforum, and every time I scripted I failed.

If anyone could give me a detail or an example script I would be fine.

1 Like

Could you please send what you have tried? We can work off from there

1 Like

Howdy there! The first step is to have the script recognize the kill.

How do I do this?

Well, you essentially want to “tag the humanoid”. Assuming your form of weapon is a firearm, you’d want the bullet script that hits the humanoid to insert an objectvalue. With this objectvalue, you will have the value set to the killer’s username.

How do make it so the script recognizes the killer’s username?
I’ll need the script of the weapon you’re using/the script you’ve attempted to complete.

Now, moving on to the actual bounty. You will create a separate script which handles the “death” function. This is where you check to see if the humanoid is dead. For example:

Player.CharacterAdded:connect(function(Character)
		local Humanoid = Character:FindFirstChild "Humanoid"
		if Humanoid then
			Humanoid.Died:connect(function()

Remember the ObjectValue that was inserted into the humanoid? Well you can check it here. You will want to have the script look for the objectvalue and the value inside of it to recognize the killer’s username. And from there you are all set to issue your bounty with that provided username.

1 Like