Any clue what I've done wrong and how I can fix it?
I can guess because part way through you're setting the value of variable 32 to equal variable 28.
You need to say equal not set
And I would assume that variable 28 is the variable you are using in the condition branch to compare with variable 32.
So it goes like this.
var 28 is the number picked
var32 = random number (1-13)
if luck is > 100
set var 32 to equal 28
if var 28 = var 32
yay you win.
So they will always win because you are making var 28 equal var 32.
Just delete that line and it will work
but the luck thing doesn't really play any part to the number being correct.
Just if you have enough luck it will process the chance you guessed the right number.
If you want the luck to be so that if you have a high luck the number will become equal to what the player guessed, then that line would be needed.
So really to have to work this out a little bit more.