Jump to content

Health indicator under name


Recommended Posts

  

On 2/23/2024 at 11:56 PM, ChessGM948 said:

it just says 0 health and doesnt update. if someone can make a better skript, please

Hello. From what I can tell this is due to your use of "loop-player's health" as this (afaik) will return all health values on the server. This should work:

on join:
	wait 1 tick
	loop players:
		set score " Health" below player to player's health for loop-player

on damage:
	victim is a player:
		loop players:
			set score " Health" below victim to victim's health for loop-player

on heal:
	event-entity is a player:
		loop players:
			set score " Health" below event-entity to event-entity's health for loop-player

Note: This is untested and may be inefficient due to the player looping. I don't know if something like "below player to player's health for all players" works, which would eliminate the need for looping. I am currently unable to test if this skript even has errors but if you have difficulties with it, please let me know.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...