XP multiplier and unmultiplier depending on kills/deaths

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

What are the errors?
8 & 20: Cant understand this section: byte tag "XPM" of nbt compound of victim is set:
15 & 27: Else has to be placed just after another "if" or "else if" section
36: Can't understand this condition/effect: set byte tag "XPM" of nbt compound of player to metadata tag "xpm" of player
 
8 & 20: Cant understand this section: byte tag "XPM" of nbt compound of victim is set:
15 & 27: Else has to be placed just after another "if" or "else if" section
36: Can't understand this condition/effect: set byte tag "XPM" of nbt compound of player to metadata tag "xpm" of player
Figured. Make sure you have SkBee!
 
ok so far, when i join my xp multiplier says x<none>
and when i try to use the heart of the see, it just says im at max already
ill lyk if i find any other bugs


when i get a kill it changes to x0
and lets me use the multiplier like expected
 
also dying to someone(not sure if its just for bedrock) doesn't lower your multiplier

and if you could, id prefer if the actionbar showed like
current multiplier
0.8
0.6
1.4

PS
this is the code with the letter changes we made


Code:
options:
    max-multiplier: 5  #can't be bigger than 127
    min-multiplier: -5 #don't make this higher than max
    # this ^ can't be smaller than -128

on death of player:
    metadata tag "xpm" of victim is not set:
        byte tag "XPM" of nbt compound of victim is set:
            set metadata tag "xpm" of victim to byte tag "XPM" of nbt compound of victim
            wait 1 tick
            set {_d} to metadata tag "xpm" of victim
            {@min-multiplier} < {_d}:
                set metadata tag "xpm" of victim to -1+{_d}
            delete byte tag "XPM" of nbt compound of victim
        else:
            send action bar "&cYou have no saved xᴘ ᴍᴜʟᴛɪᴘʟɪᴇʀ. Resetting to 0." to victim
            set metadata tag "xpm" of victim to 0
    attacker is a player:
        metadata tag "xpm" of attacker is not set:
            byte tag "XPM" of nbt compound of attacker is set:
                set metadata tag "xpm" of attacker to byte tag "XPM" of nbt compound of attacker
                wait 1 tick
                set {_d} to metadata tag "xpm" of attacker
                {@max-multiplier} > {_d}:
                    set metadata tag "xpm" of attacker to 1+{_d}
                delete byte tag "XPM" of nbt compound of victim
            else:
                send action bar "&cYou have no saved xᴘ ᴍᴜʟᴛɪᴘʟɪᴇʀ. Resetting to 0." to attacker
                set metadata tag "xpm" of attacker to 0
    metadata tag "xpm" of attacker is set:
        metadata tag "xpm" of attacker is not 0
        set {_xp} to metadata tag "xpm" of attacker
        event.setDroppedExp(event.getDroppedExp()*{_xp})

on leave:
    set byte tag "XPM" of nbt compound of player to metadata tag "xpm" of player
    
on join:
    while player is online:
        set {_d} to metadata tag "xpm" of player
        send action bar "&axᴘ ᴍᴜʟᴛɪᴘʟɪᴇʀ: &6%{_d}%" to player
        wait 2 seconds

command givexpitem <player=%player%>:
    permission: *
    trigger:
        give arg-1 heart of the sea named "&a+1 ᴇxᴘ" with lore "&eRight-Click &7to redeem a +1 xᴘ ᴍᴜʟᴛɪᴘʟɪᴇʀ"

on right click:
    name of 1 of player's tool contains "&a+1 ᴇxᴘ":
        set {_d} to metadata tag "xpm" of player
        {@max-multiplier} > {_d}:
            set metadata tag "xpm" of player to 1+{_d}
            remove 1 of player's tool from player
            send action bar "&eYou redeemed +1 xᴘ ᴍᴜʟᴛɪᴘʟɪᴇʀ!" to player
        else:
            send action bar "&eYou have hit the max xᴘ ᴍᴜʟᴛɪᴘʟɪᴇʀ!" to player
 
Last edited: