!NEED HELP ASAP, PLEASE! Sending action bar to a player stored in a metadata value

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


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


Mar 9, 2022
So I have made a skript look like this:

on damage:
  if victim is not a player:
    if attacker is a player:
      if name of attacker's tool is "&6Sweeper":
        loop all mobs in radius 5 of victim:
          if loop-entity is not victim:
            damage loop-entity by damage / 2
            set metadata value "attacker" of loop-entity to attacker
which works fine(in this part)
however in the some other parts of the code, I want to give a custom EXP value on mobs killed, and using direct damage to loop-entity won't count as being attacked by the player, this is why I used metadata value in the code up there.
so the code looks like this
on death:
  if metadata value "attacker" of victim is "<none>":
    if attacker is a player:
      if victim is a mob:
        # a lot of setting exp value and stuff, too long so i skipped it
        if {_exp} is not 0:
          set {_exp} to {_exp} / {lv::%attacker%}
          add {_exp} to {exp::%attacker%}
          send action bar "<green>Current EXP: %{exp::%attacker%}%<green>%% <gray>(+%{_exp}%%%)" to attacker
    if victim is a mob:
      set {_attacker} to metadata value "attacker" of victim parsed as a player
      #same thing here
      if {_exp} is not 0:
        set {_exp} to {_exp} / {lv::%metadata value "attacker" of victim%}
        add {_exp} to {exp::%metadata value "attacker" of victim%}
        send action bar "<green>Current EXP: %{exp::%metadata value "attacker" of victim%}%<green>%% <gray>(+%{_exp}%%%)" to {_attacker}
all the other codes works fine except for the last line "send action bar to {_attacker}", which Skript "does not understand the effect" since send action bar to a variable even if i parsed as a player (as u can see)
so I rlly need help for this since without this part of the code, my server cannot run properly and I have to kick out all the players before I can fix this, so I rlly need ur help.

Big Thanks!