SkLevels - ✅ Manage custom levels ✅ Easy API

API SkLevels - ✅ Manage custom levels ✅ Easy API 1.2

  • 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!

Supported Skript Version
  1. 2.8
Supported Minecraft Versions
  1. 1.20
SkLevels.png


Manage custom leveling systems easily !

Requires: Skript-yaml, Skript-reflect


What could be better than a way to centralize all your level systems? With SkLevels, use a very simple API to manage player levels. You can use this for jobs, class levels, and much more!​
YAML:
levels:
  #Create your levels here. You can create an infinite amount of them!
  rpg-level:
    #Min level set to default for all players
    min-level: 1
    #Max level
    max-level: 100
    #XP needed for level 1
    base-max-xp: 100
    #Multiplier that increases the maximum experience needed for each level
    #For example, setting this value to 1.50 will increase the maximum xp by 50% at each level
    max-xp-multiplier: 1.50
 
    #EVERYTHING BELOW IS OPTIONAL
    #
    #Message for leveling up
    #Placeholders:
    #{level} = new level
    #{past-level} = past level before leveling
    level-up-message:
      - " "
      - "&a&lLEVEL UP !"
      - "&a&eGG ! You are now level &a{level}"
      - " "
    #Sound to player when a player levels up
    level-up-sound:
      sound: entity.player.levelup
      pitch: 1.5
      volume: 1

Code:
SkLevelsGetCurrentXP(player, leveltype)
    Returns the current XP of a player's level
    Example: SkLevelsGetCurrentXP(player, "rpg-level")
 
SkLevelsGetCurrentMaxXP(player, leveltype)
    Returns the current Max XP of a player's level
 
SkLevelsGetCurrentLevel(player, leveltype)
    Returns the current level of a player
 
SkLevelResetPlayer(player, leveltype)
    Resets the XP and the level of a player

SkLevelsGiveXP(player, leveltype, amount)
    Gives an amount of XP to a level type

SkLevelsProgressBar(player, leveltype, barstyle, baramount)
    Returns a custom progress bar to show in a lore for example.
    barstyle represents the 'style' of the bar. For example you can type -, ▅, █...
    baramount is the length of the bar

SkLevelsUsernameRanking(leveltype, amount)
    Returns a list with all players ranked from top to bottom.
    Replace 'amount' by the amount of usernames you want to return.
    For example, 10 will return the first 10 players.

SkLevelsGetPlayerRanking(player, leveltype)
    Returns the current ranking of a player.

Code:
- on sklevelsapi xp add
    > When a player gets xp
    > Values:
        > event-string = Represents the ID of the level
        > event-integer = The given xp
        > event-player = Do I need to explain it?
       
- on sklevelsapi level up
    > When a player levels up
    > Values:
        > event-string = Represents the ID of the level
        > event-integer = The level before it levels up
        > event-player = Do I need to explain it?
Author
Palgia
Downloads
32
Views
545
First release
Last update
Rating
4.50 star(s) 2 ratings

More resources from Palgia

Latest updates

  1. UPDATE 1.2 (Ranking functions)

    Added two new functions! * SkLevelsUsernameRanking(<level id>, <amount>): This function returns...
  2. CUSTOM EVENTS

    WARNING: THIS SKRIPT NOW REQUIRES SKRIPT-REFLECT! Added events: - on sklevelsapi xp add...

Latest reviews

overall this a good skript and nice support but please consider the Nixter's suggestion to use nbt tag instead of variable. Lot of users especially me afraid of many usage of csv
Palgia
Palgia
I'm using CSV for what it was made for. If you're not running a server with +500 players there's literally no reason to be afraid. I've used some skripts with +10 variables for every players on servers with 50 players and even 100 players. No issues.
This is quite a good script, just from reading it. Adding custom events increases functionality and ease of use.

That being said, I'm worried about over usage of variables. You're giving every new player 3 variables when they join. Public servers (which this api seems designed for), especially on hosts like minehut, get hundreds to thousands of joins, even without many consistent players.


This could cause huge problems with overflowing of varabies.csv, so I recommend you instead use a byte tag, which is an nbt tag that stores an integer between -128 and 127. I also feel that you can do the entire config.yml as options, as having a config.yml does 2 things:

1. Force a download of an addon a good amount of people don't use

2. Complicate the download process by requiring things put in different folders.
Palgia
Palgia
Thanks for your review!

The csv format can handle several thousand values without problem even if it is true that this format is one of the least efficient.

It is true that this system can be improved. The advantage of variables is that it facilitates interaction with other skripts, without asking users to download an addon like SkBee.

And I like to use skript-yaml because editing yaml files is easier for users, it is closer to using a plugin, it is more "usual".

I take note of your comments, and I would certainly make an update in the future with an option to let the user choose the storage method.