Code:
variables:
{number} = 1
{blocks.%player%} = 0
{level.%player%} = 0
every second in world "world":
loop all players:
if {blocks.%loop-player%} is 15:
add 1 to {level.%loop-player%}
send "&e&lLEVEL UP&f: Congratulations &c%loop-player%&f you are now level 1&c!" to loop-player
play sound "entity.entity.player.levelup" with volume 1 to loop-player
on mine:
if event-block is coal ore:
if player's gamemode is creative:
send "&fCoal ore broken successfully&c!"
stop
else:
cancel event
set {_int} to random integer between 1 and 5
set {_item} to "%{_int}% coal" parsed as item
give {_item} to player
send "&a+%{_int}% &8Coal ore"
add 1 to {blocks.%player%}
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
stop
if event-block is iron ore:
if player's gamemode is creative:
send "&fIron ore broken successfully&c!"
stop
else:
cancel event
set {_int} to random integer between 1 and 3
set {_item} to "%{_int}% iron ingot" parsed as item
give {_item} to player
send "&a+%{_int}% &7Iron ingot"
add 1 to {blocks.%player%}
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
stop
if event-block is Cobblestone:
if player's gamemode is creative:
send "&fCobblestone broken successfully&c!"
stop
else:
cancel event
set {_int} to random integer between 1 and 10
set {_item} to "%{_int}% cobblestone" parsed as item
give {_item} to player
send "&a+%{_int}% &7Cobblestone"
add 1 to {blocks.%player%}
play sound "entity.experience_orb.pickup" with volume 0.5 to the player
stop
This above worked for me

Hope it works for you too.
It's because you need to loop all players to get a player, and then you need to change player to loop-player.
And also you don't need to make a on mine: for each block you can do it in one, like above.