# How do I...Make something a 1 in 2 chance of happening

Get help using Construct 2

### » Sat Jan 10, 2015 9:31 am

Hello, i want to create something which has a 1 in 2 chance of damaging the player. Please help!
please say if i am too vague
B
3
Posts: 1
Reputation: 177

### » Sat Jan 10, 2015 10:47 am

one way to compare choose( 1, 2) with 1
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

### » Sat Jan 10, 2015 10:49 am

This could be a high level math question of what really is a 1 in 2 chance, but try: If choose(0,1)=1 - do your thing.
B
19
S
6
G
7
Posts: 1,101
Reputation: 6,146

### » Sat Jan 10, 2015 10:51 am

You can also convert a chance into a percent, so 1 in 2 is 1x100% / 2 = 50%, so you could do during attack code set variable to int(random(0,100)) then do a compare 2 values event and variable less or equal to 50 damage is done.

If it was a 1 in 5 chance, 1X100% / 5 = 20% so int(random(0,100)), if variable less or equal to 20 then damages done.
B
43
S
23
G
21
Posts: 735
Reputation: 12,142