How to make a kill to level up system?

Let’s suppose I already made a leaderstat called “Level”

Okay, so a lot of games have a leveling system, which when you level up, you need more exp or kills or something to level up. In this case, it is kills.

How do I make a leveling up system with each level being harder to achieve?

1 Like

You could create a leaderstat folder which would hold the Number/IntValues for the Player whenever they join using a PlayerAdded event, and detect the changes from there on the server side using the .Changed Event to check if they’ve levelled up or not

game.Players.PlayerAdded:Connect(function(Player)
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = Player

    local Kills = Instance.new("IntValue")
    Kills.Name = "Kills"
    Kills.Parent = leaderstats

    local Level = Instance.new("IntValue")
    Level.Name = "Level"
    Level.Parent = leaderstats

    local KillsRequirement = 10

    Kills.Changed:Connect(function(NewValue)
        if NewValue >= KillsRequirement then
            print(Player.Name.." has levelled up! Current Level: ", Level.Value)
            Kills.Value = 0
            Level += 1
            KillsRequirement *= Level.Value
        end
    end)
end)
3 Likes