Page 1 of 1

Step By Step Health Scripting

PostPosted: Tue Aug 26, 2008 9:01 pm
by gamloth
Help With Health Scripting with a player
Well Heres what my game is.
I have a "Character" that i can't get him to die i build the health actor put a set health by variable = variable terms
but i can't get him to die at 0 health.
is that better...

Re: Step By Step Health Scripting

PostPosted: Wed Aug 27, 2008 2:26 am
by BlarghNRawr
what type of health scripting...
more info plz

Re: Step By Step Health Scripting

PostPosted: Thu Aug 28, 2008 12:46 pm
by Bee-Ant
make the healthbar actor use the sprite like this
healthbar.PNG
healthbar.PNG (491 Bytes) Viewed 745 times

make a global variable called "hp"
...

Re: Step By Step Health Scripting

PostPosted: Thu Sep 04, 2008 8:45 pm
by tlah
Bee-Ant wrote:make the healthbar actor use the sprite like this
healthbar.PNG

make a global variable called "hp"
...

alright, try making each bar a separate picture in microsoft paint or whatever. next create an actor called "hp" or what you want the hitpoints to be called. go to your main character's actor control, add a create actor, go to script editor. add this code:
Code: Select all
int hp = 7;
go add a collision with your enemy or whatever hurts your character. in collision,change the animation of the hp bar to one hp less. then in a collision (same factors), go to script editor. type:
Code: Select all
hp = hp - 1;
if(hp = 0)
{
     (replace withwhatever you want to happen);
     (replace with whatever you want to happen [takes at least 2 lines]);
}