on 1:JOIN:#:{
/set %r $rand(1,5)
if(%r == 1) /speak Hi
if(%r == 2) /speak Hey
if(%r == 3) /speak Hello
if(%r == 4) /speak Howdy
if(%r == 5) /speak Suuup
}

The above code will not work even though the variable %r gets set correctly.