Is Their Anyway I Can Make An HP Bar With The New Progress Bar?

Im trying to make an HP bar with the new progress bar where it goes up if healed and goes down if damaged, like a normal hp bar, is it possible?

1 Like

Yes, that’s possible. You just need to set the value of the progress bar to player health divided by player max health and multiply with 100. The in-world progress bar is a bit large even when the scale is set to 0, but otherwise it should work.

rule("Create In-World Text Progress Bar (custom health bar)")
{
	event
	{
		Ongoing - Each Player;
		All;
		All;
	}

	actions
	{
		Create Progress Bar In-World Text(All Players(All Teams), Health(Event Player) * 100 / Max Health(Event Player), Null,
			Event Player, 0, Clip Against Surfaces, Color(Green), Null, Visible To and Values, Default Visibility);
	}
}
3 Likes

how exactly would i divide the health while making the action

You can do it in more than one way. For example: In the value field, select Multiply, then put 100 as the first value in the multiplication, set Divide as the second value, then set Health(Event Player) as first value in the division and Max Health(Event Player) as second value: So it would look like this in the editor:

Multiply
Number
100.000
Divide 
Health
Event Player
Max Health
Event Player
3 Likes

The bar works great, but it shows 2 for people on the opposite team, how can i fix that?
edit: Its actually showing more bars, so if y have 5 people on team 1, it shows 5 bars

Do you mean multiple bars per player? If so, make sure the Create Progress Bar In-World action is only ever run once per player.

1 Like