Not tested yet, but I don't think it'd work because I assign the variable to a player's uuid, not his actual name, so idk, though I havent tested this.
The code works well , it's not a script problem.
Try to use %player% instead of %uuid of player% , it should work.