Leaderstats wont detect my kills

It will detect my Deaths but not my kills and i have no idea why

	local leaderstats = Instance.new("Folder", player)
	leaderstats.Name = "leaderstats"
	
	local kills = Instance.new("NumberValue", leaderstats)
	kills.Name = "Kills"
	kills.Value = 0
	
	local deaths = Instance.new("NumberValue", leaderstats)
	deaths.Name = "Deaths"
	deaths.Value = 0
	
	player.CharacterAdded:Connect(function(charcter)
		local humanoid = charcter:FindFirstChild("Humanoid")
		
		humanoid.Died:Connect(function(died)
			deaths.Value = deaths.Value + 1
			local tag = humanoid:FindFirstChild("creator")
			local killer = tag.Value
			if tag and killer then
				killer.leaderstats:FindFirstChild("Kills").Value += 1
			end
		end)
	end)
end)

Try printing the killer name, it could have been nil

I need it so where if i kill any player it will tell me and it also wont save when i join back into the game

I mean print the value of the tag, maybe you are setting it wrongly.

ill try and see what happens thank you

1 Like