Imo, why not use var %gay = $rand(x,y) and doubble check so u got all closing and opening brackets. I found a few of them missing.