Kills for Coins leaderboard not working!

Hello, I’m trying to make a Kills leaderboard so that it can reward a player some coins for killing a player with my gun. Yes, I’ve made a creator tag, and it will put the creator tag in there, and the value is the killer name. I am also using DataStore so I’m not sure if it is the DataStore or not, but I don’t think so. I also forgot to mention that the deaths value works just fine.

Here is my script:

game.Players.PlayerAdded:Connect(function(player)
	
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	
	local Coins = Instance.new("IntValue")
	Coins.Name = "Coins"
	Coins.Parent = leaderstats

	local Rubys = Instance.new("IntValue")
	Rubys.Name = "Rubys"
	Rubys.Parent = leaderstats

	local playTime = Instance.new("IntValue")
	playTime.Name = "playTime"
	playTime.Parent = leaderstats
	
	local Deaths = Instance.new("IntValue")
	Deaths.Name = "Deaths"
	Deaths.Parent = leaderstats

	local Kills = Instance.new("IntValue")
	Kills.Name = "Kills"
	Kills.Parent = leaderstats
	
	leaderstats.Parent = player
	
	local data
	local success, errorMessage = pcall(function()
		data = DataStore:GetAsync(player.UserId)
	end)
	
	if success and data then
		Coins.Value = data[1]
		Rubys.Value = data[2]
		playTime.Value = data[3]
		Deaths.Value = data[4]
		Kills.Value = data[5]
	else
		print("Player has no Data")
	end

	player.CharacterAdded:Connect(function(Character)
		local Humanoid = Character:WaitForChild("Humanoid")
		if Humanoid then
			Humanoid.Died:Connect(function()
				Deaths.Value = Deaths.Value + 1
				local creator = Humanoid:FindFirstChild("creator")
				local Killer = creator.Value
				if creator and Killer then
					print("player was rewarded coins!")
					Killer:FindFirstChild("leaderstats").Kills.Value = Killer:FindFirstChild("leaderstats").Kills.Value + 1
				end
			end)
		end
	end)
	
	while true do
		wait(60)
		playTime.Value = playTime.Value + 1
	end
	
	task.spawn(function()
		while true do
			task.wait(60)
			playTime.Value = playTime.Value + 1
		end
	end)
	
end)

Let me know if something is wrong, and I’ll fix the code :slight_smile: . Let me know also if you need the custom tool script if needed, but I don’t think you guys need it.

Sincerely, papahetfan