So I have this skript and when you mine a coal block you should get 1 custom xp that I created. But when I do /xp which tells me how much custom xp I have it says 0 any help?
code_language.skript:
variables:
{xp} = 0
{level} = 0
on login:
if {xp::%player%} is not set:
set {xp::%player%} to 0
if {level::%player%} is not set:
set {level::%player%} to 0
on break:
if event-block is coal ore:
add 1 coal ore to player
add 1 to {xp::%player%}
cancel event
set event-block to stone
wait 2 seconds
set event-block to coal ore
if event-block is iron ore:
add 1 iron ore to player
cancel event
set event-block to stone
wait 3 seconds
set event-block to coal ore
if event-block is lapis ore:
add 1 lapis ore to player
cancel event
set event-block to stone
wait 4 seconds
set event-block to lapis ore
if event-block is redstone ore:
add 1 redstone ore to player
cancel event
set event-block to stone
wait 5 seconds
set event-block to redstone ore
if event-block is gold ore:
add 1 gold ore to player
cancel event
set event-block to stone
wait 6 seconds
set event-block to gold ore
if event-block is diamond ore:
add 1 diamond ore to player
cancel event
set event-block to stone
wait 7 seconds
set event-block to diamond ore
if event-block is emerald ore:
add 8 emerald ore to player
cancel event
set event-block to stone
wait 8 seconds
set event-block to emerald ore
if event-block is quartz ore:
add 9 quartz ore to player
cancel event
set event-block to stone
wait 9 seconds
set event-block to quartz ore
command /ores <player>:
executable by: console or player
trigger:
clear {guiwarps::%uuid of player%::*}
open chest with 2 rows named "&cBalance: %player's money%" to player
format slot 0 of player with coal ore named "&8Coal Ore" with lore "&2$0.03" to run [player command "/coalsell"]
format slot 1 of player with iron ore named "&7Iron Ore" with lore "&2$0.09" to run [player command ""]
format slot 2 of player with lapis ore named "&9Lapis Ore" with lore "&2$0.27" to run [player command ""]
format slot 3 of player with redstone ore named "&cRedstone Ore" with lore "&2$0.81" to run [player command ""]
format slot 4 of player with gold ore named "&eGold Ore" with lore "&2$2.43" to run [player command ""]
format slot 5 of player with diamond ore named "&bDiamond Ore" with lore "&2$7.29" to run [player command ""]
format slot 6 of player with emerald ore named "&aEmerald Ore" with lore "&2$21.87" to run [player command ""]
format slot 7 of player with quartz ore named "&7Quartz Ore" with lore "&2$65.61" to run [player command ""]
command /xp:
trigger:
message "&8You have &a%{xp::%player%}% &8XP"