1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Custom xp system?

Discussion in 'Skript' started by clqrifiedwithaQ, May 16, 2021.

Tags:
Thread Status:
Not open for further replies.
  1. clqrifiedwithaQ

    Joined:
    May 12, 2021
    Messages:
    27
    Likes Received:
    1
    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.
     
  2. SoPastel

    SoPastel New Member

    Joined:
    May 17, 2021
    Messages:
    9
    Likes Received:
    2
    Something like this should work:

    Code (Text):
    1. on first join:
    2.     set {customxp::%player%} to 0
    3.     set {customlevel::%player%} to 0
    4.  
    5. on death:
    6.     if attacker is a player
    7.     add 10 to {customxp::%player%}
    8.     if {customxp::%player%} is greater than 4999:
    9.         set {customxp::%player%} to {customxp::%player%} - 5000
    10.         add 1 to {customlevel::%player%}
    11.         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)
     
    clqrifiedwithaQ likes this.
  3. clqrifiedwithaQ

    Joined:
    May 12, 2021
    Messages:
    27
    Likes Received:
    1
    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?
     
    #3 clqrifiedwithaQ, May 17, 2021
    Last edited: May 17, 2021
  4. SoPastel

    SoPastel New Member

    Joined:
    May 17, 2021
    Messages:
    9
    Likes Received:
    2
    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.
     
    clqrifiedwithaQ likes this.
  5. clqrifiedwithaQ

    Joined:
    May 12, 2021
    Messages:
    27
    Likes Received:
    1
    Thanks for all the help!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...