Skip to content

YaHudAPI

YaHudAPI allows you to manage HUD (heads-up display) displayed on a player, a NPC (non-character player), or an object. HUD contains information about the player or the team, such as the player's name, HP, the corresponding team's name, the team's icon.

Properties

boolean HudEnable

CLIENT ONLY 
YaHudAPI allows you to manage HUD (heads-up display) displayed on a player, a NPC (non-character player), or an object. HUD contains information about the player or the team, such as the player's name, HP, the corresponding team's name, the team's icon.

number MaxDistance

CLIENT ONLY 
The maximum distance between the current player's camera and the HUD, beyond which HUD is hidden.

number MinDistance

CLIENT ONLY 
The minimum distance between the current player's camera and the HUD, within which HUD is hidden.

boolean ShowMainPanelHUD

CLIENT ONLY 
Determines whether to display the main panel HUD.

boolean EnableHUDAutoScale

CLIENT ONLY 
Whether to allow the HUD to automatically scale or not.

Functions

YaUIComponent GetHudComponentByID(number id)

CLIENT ONLY 
Gets the HUD component using the player/NPC/object's ID.
  • id The entity ID of the player/NPC/object

void DisplayHud(number id, boolean value)

CLIENT ONLY 
Displays or hides the HUD component.
  • id The EntityId of the team
  • value Determines whether to display the HUD component. Defaults to true.

void DisplayHpBar(number id, boolean value)

CLIENT ONLY 
show or hide hud hp bar

void DisplayTeamName(number id, boolean value)

CLIENT ONLY 
Displays or hides the HUD team name.
  • id The EntityId of the team
  • value Determines whether to display the HUD team name. Defaults to true.

void DisplayTeamArrow(number id, boolean value)

CLIENT ONLY 
Displays or hides the HUD team arrow.
  • id The EntityId of the team
  • value Determines whether to display the HUD team arrow. Defaults to true.

void SetTeamIcon(number id, string url)

CLIENT ONLY 
Sets the icon for the team arrow.
  • id The EntityId of the team
  • url The arrow icon. The format can only be PNG, JPG, or JPEG.

void SetName(number id, string name)

CLIENT ONLY 
Sets the name to display on HUD. It defaults to the nickname in the game.
  • id The entity ID of the player/NPC/object
  • name The name to display on HUD

void SetHpBar(number id, number currentValue, number MaxValue)

CLIENT ONLY 
Sets up the HUD HP bar. You can specify the current health and the maximum health
  • id entity id
  • currentValue hpBar current value
  • MaxValue hpBar max value

void SetTeamName(number id, string name)

CLIENT ONLY 
Sets the HUD team name.
  • id The EntityId of the team
  • name The name of the team