PDA

View Full Version : Health code help?


Commando Nukem
05-01-2009, 09:38 PM
I need to add in a piece of code into the game wherein if the player is below 80 health he loses one point of health every few seconds. How would I go about doing this? :)

DeeperThought
05-01-2009, 10:16 PM
I need to add in a piece of code into the game wherein if the player is below 80 health he loses one point of health every few seconds. How would I go about doing this? :)

Something like this should work:


actor APLAYER MAXPLAYERHEALTH PSTAND 0 0

ifphealthl 80 ifcount 78
{
resetcount
addphealth -1
palfrom 20 48
sound DUKE_HARTBEAT
ifrnd 64 spawn BLOODPOOL
}


That is not tested, I just typed it...the only problem I foresee is if your player code is already using count for something else. In that case substitute your own variable and count with it.