ID:176297
Jan 27 2003, 10:27 am
|
|
anyone know how to make a code to regenerate health
|
In response to Gazoot
|
|
Erm, don't you mean<code> src.health = min(src.health+amount,src.maxhealth) </code>?
|
In response to Garthor
|
|
Garthor wrote:
Erm, don't you mean<code> src.health = min(src.health+amount,src.maxhealth) <code>? Of course I did. Thanks. /Gaz |
In response to Gazoot
|
|
Oops, I left out the / in </code>. Silly me.
|
In response to Garthor
|
|
Garthor wrote:
Oops, I left out the / in </code>. Silly me. We all make mistakes. :) |
Of course it depends on how your health system works, but I can give you the general principle. A simple way is to spawn() a health generation process whenever you want. It can be very simple, like this:
I used the min() function so you don't have to worry about passing the mobs maxhealth variable.
/Gazoot