Question when switching levels

probably a dumb question but how do i set a flag. and at the begin play on the other level i can just check if that button was pressed right?