Ok I tried to make a leaderboard. The points and kills properly shows up, but when you kill someone, your points and kills won’t go up.
game.Players.PlayerAdded:Connect(function(plr)
local stats = Instance.new("Folder")
stats.Name = "leaderstats"
stats.Parent = plr
local kills = Instance.new("IntValue")
kills.Name = "Kills"
kills.Parent = stats
local Points = Instance.new("IntValue")
Points.Name = "Points"
Points.Parent = stats
plr.CharacterAdded:connect(function(char)
local humanoid
repeat
humanoid = char:FindFirstChild("Humanoid")
wait()
until humanoid
local tag = humanoid:FindFirstChild("creator")
if tag then
local killer = tag.Value
if killer then
killer.leaderstats.Kills.Value = killer.leaderstats.Kills.Value + 1
killer.leaderstats.Points.Value = killer.leaderstats.Points.Value + 5
end
end
end)
end)