The only way that line can generate that error is if you have an alias r {} That is interfering with the mIRC identifier $r.
Try changing that line to this:
var %a $rand(1,52), %b $rand(1,52), %adata $hget(PokerDeck,%a), %bdata $hget(PokerDeck,%b)
If this works then you have a script loaded with an alias named r. It should probably be changed to something else.