I have a script located in the startergui and it if you kill the npc you earn gold. I have a saving currency. Heres script:
local player = script.Parent.Parent
local leaderboard = player:WaitForChild("leaderstats")
local currency1 = leaderboard:WaitForChild("Gold")
function onDied()
print("Dead")
currency1.Value = currency1.Value + 100
end
script.Parent.Parent.Workspace.TutPrac.Viking.Humanoid.Died:connect(onDied)
thanks!

1 comment
This script is if you are killing others players. I mean like for an NPC in workspace if the npc is dead