Attributes / Variables

Hi, i got some problems understanding the variables / attributes concept. i am trying to build a random counter (from 1 to 2). if the counter shows 1 i want some things to happen. if the counter shows 2 i want other things happend. the problem is: the counter allways shows 1.