+Philsan #1 Posted March 2, 2010 I would like to decrease health bar (pfscore2=255) according to variable FUEL (DIM FUEL=f.e) decrease (from 248 to 0). Is there a better way than seven IFs if fuel=217 then pfscore2=127 (or pfscore2=pfscore2/2) if fuel=186 then pfscore2=63 (or pfscore2=pfscore2/2) ... Thank you. Quote Share this post Link to post Share on other sites
+Random Terrain #2 Posted March 2, 2010 Whenever I have posted a math way of doing something, I'm usually told that if-thens are faster. Quote Share this post Link to post Share on other sites
+Philsan #3 Posted March 2, 2010 OK, if fuel=217 then pfscore2=127 if fuel=186 then pfscore2=63 if fuel=155 then pfscore2=31 if fuel=124 then pfscore2=15 if fuel=93 then pfscore2=7 if fuel=62 then pfscore2=3 if fuel=31 then pfscore2=1 if fuel=0 then pfscore2=0 Quote Share this post Link to post Share on other sites