I will write some information how this can be done:

1. get the world coordinates of the entity (through a vertex above the head and vec_for_vertex or just the z-pos plus any value)

2. translate that position into screen coordinates with vec_to_screen

3.1 If you want a digit display: just show a text/panel at that position.

3.2 If you want a bar displaying how much HP the enemie has left you would need to subtract half of the bars width from the x-position you got in #2 and display the panel at that location


Hope this helps a bit