Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

GetHP

Returns the current HP (hit points / life) of the mobile with ObjID.

If the mobile’s HP and MaxHP are both 0 and it is alive, Stealth automatically requests updated stats from the server.

Returns 0 if the object does not exist or the character is disconnected.

Возвращает текущие HP (очки здоровья) мобайла с ObjID.

Если HP и MaxHP мобайла равны 0 и он жив, Stealth автоматически запрашивает обновлённую статистику с сервера.

Возвращает 0, если объект не существует или персонаж не подключён.

Pascal

function GetHP(ObjID: Cardinal): Integer;

Parameters:

  • ObjID — ID of the mobile.

Python

def GetHP(ObjID: int) -> int: ...

Pascal Example

begin
  while GetHP(Self) < 50 do
  begin
    WaitTargetSelf;
    UseObject(bandage_id);
    Wait(3000);
  end;
end.

Python Example

while GetHP(Self()) < 50:
    WaitTargetSelf()
    UseObject(bandage_id)
    Wait(3000)

See Also

GetMaxHP, GetStam, GetMana, RequestStats