ID:176064
 
...Ive asked this question a long time ago, but i was a newbie then and i couldnt quite under stand the answer, and i try to search it and its not there, any way how to i have somthing like


if([input is at %25])
//blah blah blah


Wanabe wrote:
...Ive asked this question a long time ago, but i was a newbie then and i couldnt quite under stand the answer, and i try to search it and its not there, any way how to i have somthing like


if([input is at %25])
//blah blah blah

I don't quite understand what you are asking but to get 25% of something you multiply it by 0.25. So for example if you want to check if a players HP is less than 25% of thier max you'd do something like

if(src.HP < src.MaxHP * 0.25)
In response to Theodis (#1)
Theodis wrote:
Wanabe wrote:
...Ive asked this question a long time ago, but i was a newbie then and i couldnt quite under stand the answer, and i try to search it and its not there, any way how to i have somthing like


if([input is at %25])
//blah blah blah

I don't quite understand what you are asking but to get 25% of something you multiply it by 0.25. So for example if you want to check if a players HP is less than 25% of thier max you'd do something like

if(src.HP < src.MaxHP * 0.25)

HeHe dont worry about it, Thanks thats exactly what i needed :-)