So I have made a skript look like this:
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
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!
code_language.skript:
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
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
code_language.skript:
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
else:
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}
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!