#XP Percentage

1 messages · Page 1 of 1 (latest)

glass pumice
#

I need help creating a feature that displays the player's progress towards the next XP level as a percentage. It should also match the player's level bar and xp points

#
    trigger:
        set {_currentLevel} to player's level
        set {_currentXP} to player's experience points
        set {_xpNeededForNextLevel} to 0
        
        # Calculate the total XP required to reach the next level
        if {_currentLevel} < 16:
            set {_totalXPForNextLevel} to (2 * {_currentLevel} + 7) + (level of player * level of player + 6 * level of player) / 2
        else if {_currentLevel} < 31:
            set {_totalXPForNextLevel} to (5 * {_currentLevel} - 38) + (level of player * level of player + 6 * level of player) / 2
        else:
            set {_totalXPForNextLevel} to (9 * {_currentLevel} - 158) + (level of player * level of player + 6 * level of player) / 2

        set {_xpNeededForNextLevel} to {_totalXPForNextLevel} - {_currentXP}
        
        send "You need %{_xpNeededForNextLevel}% more XP to reach the next level." to player```
#

This doesnt work but it is smth like that.

cerulean heath
#

“It should also match the player's level bar and xp points”
Why not just use the normal xp bar then?

glass pumice
cerulean heath
#

Use this and the experience expression

glass pumice
#

im lkooking for smth like this

glass pumice
glass pumice
cerulean heath
cerulean heath