For example, I wanted a game that records how many kills you have will level you up depending on the amount of kills recorded. I wanted the amount of kills on a GUI. This is my code but unfortunately it did not work and I cannot figure it out. The script is in a tool.
tool = script.Parent
bullet.Touched:connect(function(hit) -- Consider that this bullet kills a person in one hit
wait(0.1)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
plr = tool.Parent:GetPlayerFromCharacter(hit)
plr:FindFirstChild("PlayerGui").Kills.Value = plr:FindFirstChild("PlayerGui").Kills.Value + 1
end
end)
Too make it complicated, I wanted a script to track if a kill was made, not if a bullet hit a humanoid/player.
Please help? This will help me in the big run.

2 comments
You are right, but if I want to record kills from humanoids that are not players, such as zombies.
Leaderstats works for non-players too.