if(getrandom(0,100) < 40){//do attack}
For the chance, do the followingCode: [Select]if(getrandom(0,100) < 40){//do attack}else{//do other attack}Where 40 is the percent.
if(getrandom(0,100) < 40){//do attack}else{//do other attack}