Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBPro] Health Bar function that works like box command

Author
Message
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 30th Sep 2006 17:45 Edited at: 30th Sep 2006 17:52
I made a health bar function that can change the bar's color based on your health. I'm going to use it so I thought I'd post it here. Maybe it's useful for an RPG or RTS?

Here's the main function

-First 4 parameters work like the box command.

-"Health" is the amount of health that whoever the health bar is for has.


-"MaxHealth" is the maximum health that they can have.

-HighHealthColor,MediumHealthColor,LowHealthColor,AlmostDeadHealthColor:
The color of the health bar when that thing is the case. For example, HighHealthColor would say what color the health bar is when you have high health. I may make this green.




If you include the main function in your code, you can use a simpler one that takes only one color.

Simpler:






Here's an example:



Ummm...

Login to post a reply

Server time is: 2024-11-23 04:01:40
Your offset time is: 2024-11-23 04:01:40