How do I Make % Chance Sumtin wil happen

How do i make it like say, if a mc is at a certain frame that there will be like a 50% that the enemy will react in a certain way. Im trying to do sum ai, thx