Page 1 of 1

need help plz

PostPosted: Wed Aug 05, 2009 5:48 pm
by sirmashni1
how we can add a % for exemple if you have 50% to miss attack or for critical hit?

Re: need help plz

PostPosted: Wed Aug 05, 2009 9:47 pm
by skydereign
In the code have this.
Code: Select all
int chance = rand(2);
if(chance==1)
{
    // attack
}

rand(2) can give 0 or 1, making it a fifty percent chance. If you need help with the attack, I will need info about the attack itself.

Re: need help plz

PostPosted: Wed Aug 05, 2009 10:01 pm
by sirmashni1
its ok thx! :D