Need help making a kills system for the new roblox FPS System template

Im working on a game utilizing the new Roblox FPS System template. I am currently trying to make a kill counter but it does not work. Here is the script.

local Players = game:GetService("Players")
-- Create a template for leaderstats
local Template = Instance.new("Folder")
Template.Name = "leaderstats"

-- Add Kills and Deaths as IntValues
local Kills = Instance.new("IntValue")
Kills.Name = "Kills"
Kills.Value = 0
Kills.Parent = Template

local Deaths = Instance.new("IntValue")
Deaths.Name = "Deaths"
Deaths.Value = 0
Deaths.Parent = Template

Players.PlayerAdded:Connect(function(Player)
	wait(1)
	local Stats = Template:Clone()
	Stats.Parent = Player

	Player.CharacterAdded:Connect(function(Character)
		local Humanoid = Character:FindFirstChild("Humanoid")
		if Humanoid then
			Humanoid.Died:Connect(function()
				for _, Child in pairs(Humanoid:GetChildren()) do
					if Child:IsA("ObjectValue") and Child.Value and Child.Value:IsA("Player") then
						local Killer = Child.Value
						if Killer:FindFirstChild("leaderstats") then
							local KillerStats = Killer.leaderstats
							local KillerKills = KillerStats:FindFirstChild("Kills")
							if KillerKills then
								KillerKills.Value = KillerKills.Value + 1
							end
						end
						Deaths.Value = Deaths.Value + 1
						return
					end
				end
			end)
		end
	end)
end)

I believe i know the issue.
The game doesn’t recognize the guns as proper tools, and only functions with gears like a sword.

If somebody could help, that would be great. Thanks! :slightly_smiling_face: