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 / Health Bar Script Help

Author
Message
Slayer1918z
14
Years of Service
User Offline
Joined: 18th Jun 2010
Location:
Posted: 27th Jan 2011 23:49 Edited at: 28th Jan 2011 00:25
Well, I was wondering if there is any way to increase the player max health during the game. I am trying to to make a script that will display a health bar of the players health and increase based off of the players health. So basically, if the player is lv1 his health may be 50 but at lv5 his health may be 68 (max health).
Here is the script...



I would greatly appreciate any help.

<EDIT>
I know that I didn't use dimvar= for any of the CalcVar's, but that is because I used that already in the EXP script so it is all good, that is not what the problem would be.
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 28th Jan 2011 06:45
Do you have PB? "scalehudx" is not available in stock FPSC.

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
Slayer1918z
14
Years of Service
User Offline
Joined: 18th Jun 2010
Location:
Posted: 28th Jan 2011 13:01
yep
Slayer1918z
14
Years of Service
User Offline
Joined: 18th Jun 2010
Location:
Posted: 29th Jan 2011 16:30
It been two days so I'm really wondering, can anybody can help? I really need some help with this.
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 29th Jan 2011 19:10
I'm sorry I don't know PB that well so I can't help you. I'm sure someone else will help you eventually.

[url="http://raptr.com/No_Turn_Right?src=em_forum"][/url]
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 1st Feb 2011 19:33
Okay, I've looked at the script, and I'm not sure I have enough info to help out here.


What are you wanting help with? Is the script not working? What is the script supposed to be doing that it's not? What sort of problems are you encountering?


The one and only,


Only those who sow the seeds of their desires will reap their benefits later.
However, I have seeds of my own to tend to. I don't have time to be someone else's watering can.
Slayer1918z
14
Years of Service
User Offline
Joined: 18th Jun 2010
Location:
Posted: 12th Feb 2011 17:59
Sorry that I didn't see your post sooner Plystire, but I didn't see anyone respond for a long time so I figured no one did.
Anyways, if you will still take a look at this, the problem I am having is setting a new max health for the player. For example, at lv1 the player may have 50 health, but at level 5 he may have 75 health. I am trying to make it so that the players max health increases when he levels up but the player can still take damage and die and everything.
Turtle Productions
15
Years of Service
User Offline
Joined: 22nd Jan 2009
Location: Finland
Posted: 14th Feb 2011 20:16
Hey Slayer1918z, check out this - I've made a simple script where you can set the max hp to another amount than starting (so it theoretically will be the max amount but the player can't see when it is changed to the new starting hp).

Thanks,
TP
Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 16th Feb 2011 00:52
You can check out Turtle's script for some more direction, but I can describe the basic setup for such a system here as well.

You will want to set the player's maximum health to something insanely high like 99999. That will allow you to manually set the player's health to the desired maximum through a script. I would personally keep track of the player's maximum health through a variable, to make checking and setting easier.

Example code:


I'm making the assumption that you're using either PB or the latest update (which now includes PB's variable system). This will check if the internal variable $PH (grabs the player's health from inside the engine and places that value into the script) is greater than the user variable called "PlrMaxHealth". If it is, then the player has more health than they should have, so it will use "setplrhealth" (can someone confirm if this is the correct command? I've actually not used it before, lol) to set the player's health to that of the "PlrMaxHealth" variable, keeping the player at that health level or lower.

To give the player MORE max health, just change the "PlrMaxHealth" variable to whatever you want their maximum health to be!


If you have any questions on this, let me know (email would get you a faster response, as I check email 100x more often than the boards )


The one and only,


Only those who sow the seeds of their desires will reap their benefits later.
However, I have seeds of my own to tend to. I don't have time to be someone else's watering can.

Login to post a reply

Server time is: 2024-11-24 12:26:31
Your offset time is: 2024-11-24 12:26:31