Here's an example I just made for ya. It handles 20 enemies, each with 100 health getting reduced by 10 when you are hitting them. Ignore the "on screen display" stuff, for it is there so you can view the instructions and has nothing to do with the enemy health stuff. It may look confusing but read carefully...
REM Project: Handling Enemy Health
REM Created: 6/26/2007 6:02:07 PM
REM
REM ***** Main Source File *****
REM
rem Setup Game
sync on
sync rate 60
autocam off
Set Text Size 12
Set Text Font "Verdana"
rem Create the Enemy Health Array.
DIM EnemyHealth(20)
rem Make the Player Sphere
PlayerOBJ=100
Make object sphere PlayerOBJ,10
rem Create the enemies and set their health to 100
for e = 1 to 20
make object cube e,10
position object e,-100+rnd(200),0,-100+rnd(200)
color object e,RGB( 0,rnd(255),rnd(255) )
EnemyHealth(e)=100
next e
rem Set your attack range.
AttackRange=30
rem Make a visible guide to show your range (just for visual aid)
make object box 40,1,1,AttackRange
color object 40,rgb(255,0,0)
ghost object on 40
set object ambient 40,0
rem Make a grid for visual aid (not important either)
Make MAtrix 1,1000,1000,30,30
position matrix 1,-500,-10,-500
rem Start the loop
DO
ink rgb(255,155,155),0
rem Set your speed to 2
Speed=2
rem Allow the player to move around.
if upkey() then move object PlayerOBJ,Speed
if downkey() then move object PlayerOBJ,-Speed
if leftkey() then yrotate object PlayerOBJ,wrapvalue(ay#-Speed)
if rightkey() then yrotate object PlayerOBJ,wrapvalue(ay#+Speed)
rem Store the player's X,Y,Z positions
x#=object position x(PlayerOBJ)
y#=object position y(PlayerOBJ)
z#=object position z(PlayerOBJ)
rem Store the player's Y angle
ay#=Object Angle Y(PlayerOBJ)
rem Get the position at which the attack range ends.
RangeX#=NewXValue(x#,ay#,AttackRange)
RangeZ#=NewZValue(z#,ay#,AttackRange)
rem Get the position for the attack range visual aid thingy (not important)
VisualAidPositionX#=NewXValue(x#,ay#,AttackRange/2)
VisualAidPositionZ#=NewZValue(z#,ay#,AttackRange/2)
rem Update the visual thingy.
position object 40,VisualAidPositionX#,y#,VisualAidPositionZ#
yrotate object 40,ay#
rem Control our enemies!
for e = 1 to 20
rem If they're not dead and they are in the screen then print their health on them.
if EnemyHealth(e)>0 and object in screen(e) then TEXT Object Screen X(e),object screen y(e),str$( EnemyHealth(e) )
rem If you press ENTER while hitting an enemy then decrease that enemy's health by 1.
if intersect object(e,x#,y#,z#,RangeX#,y#,RangeZ#)>0 AND Returnkey() AND EnemyHealth(e)>0
EnemyHealth(e)=EnemyHealth(e)-1
endif
rem if the enemy's health reaches 0, then hide the enemy's object
if EnemyHealth(e)<=0 then hide object e : else : show object e
next e
rem Use the spacebar to ressurect all of the enemies
if spacekey()
for e = 1 to 20
EnemyHealth(e)=100
next e
endif
rem Control the camera
set camera to follow x#,y#,z#,ay#,50,100,3.5,0
point camera x#,y#,z#
rem Handle the on screen display thing (ignore this, as it has nothing to do with this program.)
On_Screen_Display_Title$="MULTIPLE ENEMY HEALTH DEMO (simple)"
On_Screen_Display_Controls$="Use the arrow keys to move around, ENTER to attack, and SPACE to ressurect/heal all the enemies."
On_Screen_Display(On_Screen_Display_Title$ , On_Screen_Display_Controls$ , "" , rgb(155,255,155))
SYNC
LOOP
rem ===================================================
rem
rem Ignore this. It's the On-Screen-Display function.
rem
rem ===================================================
Function On_Screen_Display(Title$,Controls$,Controls2$,color)
if Keystate(35)=1
rem On Screen Text:
ink rgb(55,55,55),0
Star$=""
for s = 1 to len(Title$)+8
Star$=Star$+"*"
next s
if Text Width(STAR$)>Text Width(CONTROLS$) then Longest$=Star$ ELSE Longest$=Controls$
if Text Width(Controls2$)>Text Width(Longest$) then Lognest$=controls2$
if Controls2$="" then Bottom=100 : else : Bottom=120
box 0,0,Text Width(Longest$)+10,Bottom
ink Color,0
TEXT 0,0,Star$
Text 0,20,Title$
Text 0,40,Star$
Text 0,80,Controls$
TEXT 0,100,Controls2$
ELSE
ink color,0
Text 0,0,"Hold down 'H' for HELP."
ENDIF
Endfunction