#I want to make my leaderboard stats save

5 messages · Page 1 of 1 (latest)

distant sierra
#
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 deaths = Instance.new("IntValue")
    deaths.Name = "Deaths"
    deaths.Parent = stats

    local rank = Instance.new("StringValue")
    rank.Name = "Rank"
    rank.Value = "Beginner"
    rank.Parent = stats

    kills.Changed:Connect(function(NewKills)
        if NewKills >= 10 then
            rank.Value = "Novice"
        end
    end)

    plr.CharacterAdded:connect(function(char)
        local humanoid
        repeat
            humanoid = char:FindFirstChild("Humanoid")
            wait()
        until humanoid
        humanoid.Died:connect(function()
            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)
sinful parrot
#

Well, try to research how to do it, this is an help channel.

distant sierra
#

isnt that the Point??

#

to help

sinful parrot
#

That's not helping, is literally creating