I have this code and i want to set the variable {_xp} to the amount of experience a player has got so later on i can give it to them with the vanilla minecraft command /experience add %player% %{_xp}%, but when i set it to the level of the player it set its to the level, not the amount. is there a way i can make it so either the command gives levels, or it sets the variable {_xp} to the amount of xp?
Im not using any skript add ons, this isnt my server and he refuses to put them on, im unsure why.
Code:
command /xpbottle:
trigger:
set {_xp} to level of player
execute console command "/experience set %player% 0"
give player paper named "XP Bottle ≫ &a%{_xp}%" with lore "&a%{_xp}%" and "&aRight Click to redeem your XP!"
on right click holding paper:
if name of tool contains "XP Bottle ≫":
set {_xp} to line 1 of lore of player's held item
remove 1 of player's held item from player's inventory
execute console command "/experience add %player% %{_xp}%"
send "&9You have redeemed &a%{_xp}% &9XP!"
Im not using any skript add ons, this isnt my server and he refuses to put them on, im unsure why.