Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Help with a Health regenerating script.

Author
Message
Dark Frager
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: The Void.
Posted: 24th Oct 2011 21:51 Edited at: 24th Oct 2011 21:53
Hi,

I recently modified a health regeneration script by someone on the forums here so it shows a hud when the players health drops below 20.
It works fine, but the health does not regenerate. It worked fine before I modified it, but now there seems to be something wrong with it. This is the first script I've EVER modified (first time I actually used FPI) and Im surprised I even managed to get the hud show up.

Here is the script.



"I guarantee you'll miss me, 'cause you changed the way you kissed me." www.youtube.com/TheDarkFrager
Spare 2 seconds of your life and subscribe to me please.
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 24th Oct 2011 22:00 Edited at: 24th Oct 2011 22:06
Take a look at your first line (state=0). At the end you have the "state=3", so your script jumps from line 0 to line 3, then line 4. It never reaches "state=2" where you are adding health.

You also have a syntax error in this line:



Script is jumping back to state=0 and not state=3, so it will just loop and not do anything.

Huds should *always* be defined in the state=0 line(s):



Always define your huds in the beginning "state=0" lines. Then do the rest of your scripting when you use the "state=0:state=1" line. Also I would recommend changing the "timergreater" to "etimergreater".


Twitter: @NFoxMedia
Dark Frager
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: The Void.
Posted: 24th Oct 2011 22:04 Edited at: 25th Oct 2011 13:46
Hmm, I never realized it said state=3 there.

Thanks for the help BlackFox!

EDIT:

I messed with the script a bit, but now the hud does not show up but the health regenerates.



I'm pretty sure it's something to do with the
Quote: ":state=2,plrhealthgreater=99:state=0"
line.

"I guarantee you'll miss me, 'cause you changed the way you kissed me." www.youtube.com/TheDarkFrager
Spare 2 seconds of your life and subscribe to me please.
Dark Frager
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: The Void.
Posted: 25th Oct 2011 20:42
Bump.

Sorry for the double post, but I need help with this.

"I guarantee you'll miss me, 'cause you changed the way you kissed me." www.youtube.com/TheDarkFrager
Spare 2 seconds of your life and subscribe to me please.
Lewis
VBOTB Developer '10
19
Years of Service
User Offline
Joined: 16th Mar 2005
Location: Queensland, Australia
Posted: 26th Oct 2011 04:32
Dark Frager,

you're using the GUIX9 commands for showing and hiding the hud.

Replace
'showhud' and 'hidehud'
with
'hudshow' and 'hudunshow'

Dark Frager
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: The Void.
Posted: 26th Oct 2011 12:37
Thanks Lewis. I remember using those commands, but when I started over, I muddled them up.

"I guarantee you'll miss me, 'cause you changed the way you kissed me." www.youtube.com/TheDarkFrager
Spare 2 seconds of your life and subscribe to me please.

Login to post a reply

Server time is: 2024-11-24 05:02:55
Your offset time is: 2024-11-24 05:02:55