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.
PlayerGui gets wiped every time the player dies, so you will lose your stats. It's better to use the leaderstats system. This will make the kill count show up on the player list on the top right corner.