I put this script inside a NPC with a humanoid inside it and this is a SS script
local plr = game.Players.LocalPlayer if script.Parent.Humanoid.Health == 0 then plr.leaderstats.Currency.Value = plr.leaderstats.Currency.Value + 10 end
Add a server script into serverscriptservice and use this code
game:GetService("Players").PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) char:WaitForChild("Humanoid").Died:Connect(function() player.leaderstats.Currency.Value += 10 end) end) end)
So we are functioning when a player joins and check when the character joins so we can run a function to check when the player dies and when they do we are gonna reward the player some currency