im trying to make a halo mlg mod
first thing im trying to do right now is make a shield system, checking for when the player takes damage, and subtracting from shield and waiting for the shield var hit 0 before starting to subtract from health, however the reason i want to do this is to (instead of a health bar) make a shield bar... simple for most, but for a newb like me its a perfect task to get me started!
12 bullets (all heashot) = kill
1 bullet (no sheild) = kill
9 bullets (all headshots) = drop sheild
^^ cant figure out how to do the math to make this accurate
however im not sure if im able to create variables out of the clear blue sky... however i know that if i could i would use the health bar code:
im not sure exactly how to write the code
i have no idea if this is even the best method to go about starting to write this simply complicated code
self.maxshield = 100;
self.currentshield = self.maxshield; // only on player spawn
self.maxhealth = 100;
while( (self.maxhealth == 100) && (self.currentshield <= 100) )
//draw shield bar 1/3 space of screen width centered on the top of the screen <- sheild.bar
while( (self.health == 100) && (self.currentshield != 100) )
while ( player takes no damage ) //not sure how to detect for this
wait 3.0; //3 seconds?
//recharge shields making sure it can be interrupted -- possibly a new thread?
any and all help will be appreciated
if you write the entire code i will add a credit for you on player spawn for your help. <- this i KNOW how to do