This script is bond to a sword as the parent
local hit = script.Parent.Handle.Touched
local player = game.Players.LocalPlayer
local stats = player:WaitForChild("Money")
local sp = stats:WaitForChild("Money")
if hit.parent.Humanoid.Health <= 0 then
sp.value = sp.value + 300
end
Changed it but i said i wanted to get a stat increase from an NPC not you dieing
local Handle = script.Parent.Handle
Handle.Touched:Connect(function(part)
local player = game:GetService("Players"):GetPlayerFromCharacter(part.Parent)
if player then
local stats = player:WaitForChild("Stats")
local sp = stats:WaitForChild("Money")
local zombie = part.Parent:findfirstchild("Zombie")
local humanoid = zombie.humanoid
if humanoid.Health <= 0 then
sp.Value = sp.Value + 300
end
end
end)

2 comments
Wait a second why does it increase so much when i die? Instead of 300 it gave me 3000
you might have to add a debounce