Gain +5 coins when killing another player

How would I make it so when someone kills another player they get +5 coins? I watched multiple different videos on it but it did not help me out as they’re doing a whole leaderstats script which I do not need as I already have one, I only just need the part where when someone kills another person they get +5 coins.

If someone can put me in the right direction on making one or send me a tutorial that would be awesome.

1 Like

You could maybe create and fire a BindableEvent when you kill a player, and use another script to check if the BindableEvent was fired, and add to the player’s coins if so.

Are there any youtube tutorials I could follow on how to make a Bindable Event? I have very little to no knowledge about scripting.

1 Like

This goes into detail about how Roblox used to use a creator tag on its older gears/tools to determine kills.

1 Like

Here’s a tutorial showing you how to use them: Roblox Bindable Events Tutorial - YouTube, if you want, you could just add the coins to the player inside the weapons’ script and using BindableEvents wouldn’t be neccesary, but it might maybe look a little messy.

I just tried that script and it isn’t working

local hum = char:WaitForChild("Humanoid")

hum.Died:Connect(function()
	local tag = hum:FindFirstChild("creator")
	if tag then
		local player = tag.Value
		local coins = player.leaderstats.Coins
		coins.Value = coins.Value + 5
	end
end)

I advise you to look at how Roblox’s Linked Sword uses creator tags.

https://www.roblox.com/catalog/125013769/Linked-Sword

i’m just going to tell you right now, you’re going to need to show your weapon’s code. Otherwise no one can help.

1 Like