So I am trying to make a leaderboard that when a Zombie is killed with a humanoid named Zombie that when it is killed it gives you cash as a result That saves because I plan on making a shop with it. So here is what I have but it does not register the zombie when it is killed and also it does not save
Any help is appreciated
Thanks
local folder = Instance.new("Folder",player)
folder.Name = "leaderstats"
local currency1 = Instance.new("IntValue",folder)
currency1.Name = "Cash"
player.CharacterAdded:connect(function(character)
character:WaitForChild("Humanoid").Died:connect(function()
local tag = character.Humanoid:FindFirstChild("Zombie")
if tag ~= nil then
if tag.Value ~= nil then
currency1.Value = currency1.Value + 10
end
end
end)
end)
end)