i did :)
/set %8ball $rand(1,6)
u should do
var %8ball = $r(1,6)
var makes it a local variable, no need to be global :P