Hi! I would like some help with a problem I'm having, I'm trying to create a plugin that makes it so that when someone is killed/dies it drops their head and if someone right clicks with it uses it and transforms it with the player's skin and nickname and that we can deactivate it with the command "/unskin" with the plugins skinsrestorer and nicknamer the problem being that I don't have the impression that my nicknamer doesn't work (I'm in version 1.21.1) in short the script doesn't give me the nickname of the player and transforms the person I killed with my skin which is the opposite
my script :
on death of player:
if attacker is a player:
set {_head} to skull of victim
set name of {_head} to "%victim%"
set lore of {_head} to "pseudo:%victim%"
drop {_head} at location of victim
on right click with skull:
set {_clicker} to player
set {_item} to player's tool
if {_item} is not air:
set {_lore::} to lore of {_item}
loop {_lore::}:
if loop-value starts with "pseudo:":
set {_pseudo} to loop-value
replace all "pseudo:" with "" in {_pseudo}
if {_pseudo} is {_clicker}'s name:
send "&cTu ne peux pas te transformer en toi-même !" to {_clicker}
stop
set {_cmdSkin} to "skin set %{_clicker's name}% %{_pseudo}%"
set {_cmdNick} to "nick set %{_clicker's name}% %{_pseudo}%"
execute console command {_cmdSkin}
execute console command {_cmdNick}
remove 1 skull from {_clicker}'s inventory
send "&aTu es maintenant déguisé en %{_pseudo}% !" to {_clicker}
stop
command /unskin:
trigger:
execute console command "skin clear %player%"
execute console command "nick reset %player%"
send "&eTu es redevenu toi-même."