Do Sensor command only once

C'mon, I really need your help. Someone told me of a boolean. Can anyone explain, how to use that