• Hey! Register here to create your account, engage with the community, and talk about what is new!

Can Show Action Bar Text be used to show an opponents current health?

TheSuperKaioken

New member
Joined
Mar 8, 2022
Messages
2
Reaction score
1
So, I'm making a combat game with a friend, and I want to be able to show text that shows the health of the opponent you last attacked in text form. I purchased the "Show Action Bar Text" to see if that would make for a good enough health display. So, now on to the big question, can you use the "Show Action Bar Text" to make a health display for your opponent, if so, how? If not, well, how do you make one?

Thanks!

(Also the game is called PVPVP and it's super aesthetically displeasing, play it anyway it's kinda cool)
 

ARMcPro

Forum adept
Overlord
Joined
Oct 20, 2020
Messages
1,255
Reaction score
352
Yes, it's possible.
If you want it to always show the latest enemy health (even when you don't hit them in a while), you need a loop. If not, it's easier.

1- Without Loop:
On Player Damage Player Event, place the Show Action Bar Text, and inside the chest, get a Game Value (should bea name tag) (from the Values iron ingot). Now hold the game value and type "Health" or "Current Health", and click on the health thing (should be a normal apple), then shift-right click with the game value and click on Victim (skeleton skull) and put the game value in the chest (the game value's lore should say something like Target: Victim).

2-With Loop:
In Player Damage Player Event, get q variable and name it "%damager hit" and set it to text called "%victim".
In the player's loop, put a Select Players By Name, and inside the chest put a variable called "%default hit"
after that, place the Show Action Bar Text; shift-right cluck the sign and click on Default (if you don't change it, it automatically triggers only for the current selection) inside the chest, get the same value as before but instead, shift-right click it and select Selection or Selected (should be a netherstar). after that just place a Reset Selection and it should work.
 
Top Bottom