Jump to content
Sign in to follow this  
Philsan

PFSCORE health bar decrease

Recommended Posts

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.

Share this post


Link to post
Share on other sites

Whenever I have posted a math way of doing something, I'm usually told that if-thens are faster.

Share this post


Link to post
Share on other sites

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

icon_mrgreen.gif

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...