How to make a prestige level cap (solved)

So, in my game I want players to stop prestiging after Prestige 10. When they hit prestige 10 I want their level to stop resetting on 100 and just go on infinitely. I followed a tutorial for a level cap just modified it for prestige. (Image listed below)

The problem is the system still resets their level and increases the needed xp amount. Is there a better way to execute this to get the effect I want to achieve?

Here’s my leveling system for reference-

1 Like

In the level.Changed event, have you tried checking if the player’s Prestige.Value has reached the cap? Here’s an example:

level.Changed:Connect(function()
    -- If the level hasn't reached the requirement,
    -- this event doesn't matter, right?
    if level.Value < requiredLevels.Value then
        return
    end

    -- If the prestige hasn't reached the cap yet,
    if prestige.Value < prestigeCap then
        -- reset the level and increase the required experience points here.
    end

    prestige.Value += 1 -- Increase the prestige,
    -- without necessarily having to reset the level and increase the required EXP.
end)
1 Like

Yeah I found a solution, pretty much set it up to check if the prestige level is 10. If it is then it caps off the level, stops resetting the level, and doesn’t increase the needed exp amount per level

Nice. I think may have misunderstood you in your first post, though.

Also, since you’re really not doing anything in that if statement and only in the elseif statement, you should modify it.

if Prestige.Value < 10 then
    level.Value = 1
    Prestige.Value += 1
    RequiredExp.Value += 1000
end

This just gets rid of the unnecessary lines of code.

Alrighty I’ll try that out in the morning!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.