The code I made, the deaths works but not kills. Can somebody help?
game.Players.PlayerAdded:Connect(function(plr) local stats = Instance.new("Folder") stats.Name = "leaderstats" stats.Parent = plr
local kills = Instance.new("IntValue")
kills.Name = "KOs"
kills.Parent = stats
local deaths = Instance.new("IntValue")
deaths.Name = "WOs"
deaths.Parent = stats
plr.CharacterAdded:Connect(function(char)
local humanoid
repeat
humanoid = char:FindFirstChild("Humanoid")
wait()
until humanoid
humanoid.Died:Connect(function(char)
deaths.Value = deaths.Value + 1
local tag = humanoid:FindFirstChild("creator")
if tag
then
local killer = tag.Value
if killer then
killer.leaderstats.Kills.Value = killer.leaderstats.Kills.Value + 1
end
end
end)
end)
end)

1 comment
Is this supposed to be a regular leaderstats script or is it a custom leaderstats?