Solved Custom xp system?

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
May 12, 2021
27
1
3
24
I want to make the xp requirement for each level 5000, whether through the xp bar or any other variable that could keep track of xp intake. Ideally something that could be displayed on the sidebar or tab.
 
I want to make the xp requirement for each level 5000, whether through the xp bar or any other variable that could keep track of xp intake. Ideally something that could be displayed on the sidebar or tab.

Something like this should work:

Code:
on first join:
    set {customxp::%player%} to 0
    set {customlevel::%player%} to 0
  
on death:
    if attacker is a player
    add 10 to {customxp::%player%}
    if {customxp::%player%} is greater than 4999:
        set {customxp::%player%} to {customxp::%player%} - 5000
        add 1 to {customlevel::%player%}
        send "You leveled up to: %{customlevel::%player%}%" to attacker

This will give each individual player a customxp and custom lvl, then you just need to add to this whenever you want them to gain xp. (The example I gave is when the player kills an entity)
 
  • Like
Reactions: clqrifiedwithaQ
Something like this should work:

Code:
on first join:
    set {customxp::%player%} to 0
    set {customlevel::%player%} to 0
 
on death:
    if attacker is a player
    add 10 to {customxp::%player%}
    if {customxp::%player%} is greater than 4999:
        set {customxp::%player%} to {customxp::%player%} - 5000
        add 1 to {customlevel::%player%}
        send "You leveled up to: %{customlevel::%player%}%" to attacker

This will give each individual player a customxp and custom lvl, then you just need to add to this whenever you want them to gain xp. (The example I gave is when the player kills an entity)
Thanks, is there a way the xp can increase when you collect an xp orb? Also, do these variables exist in other scripts too or just the one I made them in?
 
Last edited:
Thanks, is there a way the xp can increase when you collect an xp orb? Also, do these variables exist in other scripts too or just the one I made them in?

There is an "on experience change" function, which will imitate an experience orb collection, but you need to download the addon SharpSK for it. Also you can reference the variables across separate scripts if they are not local.
 
  • Like
Reactions: clqrifiedwithaQ
Status
Not open for further replies.