I won't give you code, but I'll explain how you'd do it. If you still can't figure it out, then I'll try to help you some more.
Ok, so, a health bar. What is a health bar? It's a box, more specifically a rectangle. What can we use in DBP that allows us to create a health bar? Well, fortunately for you, there happens to be a "box" command
. It's code is: "box left position, top position, right position, bottom position". Try it. Play around with it, until you get what you want.
Health bars aren't normally white. So we'll make it red. There just happens to be code for changing the color of things you write and draw. It's called "ink". Now the code for this is: "ink foreground color, background color". But the computer doesn't read the colors just if you type "red" or "blue", you have to give it a number, but since there are something like 16 million posibilities, the chances that you'll guess the right one are slim. So there's another command that lets the computer calculate the number for you, called "rgb". RedGreenBlue. You give it a red value, a blue value, and a greeen value in this order: "rgb( red, green, blue )", just like it says. The value has to be between 0 and 255, don't ask me why, but that's how the computer reads it
. 0 is the darkest version of that color (black), and 255 the lightest version. So if you give it an rgb value of (100, 0, 100), it will give you what color? Medium red and medium blue combined gives you...medium purple
. So give it whatever color you want, it doesn't have to be red, so it'd look something like this: "ink rgb( 200, 0, 0 ), 0" (background color doesn't matter). Now you have a simple health bar
. If you want me to go into more detail (adding it into 3D and decreasing/increasing it) then tell me, but I don't want to waste time telling you if you don't want to know.