GetHorseHealth
A horse’s health.
0 .. 100; 100 when it is made. A player’s blow or arrow takes the model’s damage off it (OnHorseDamage); at 0 it
is dead (OnHorseDeath). The server forgets it with the horse: a mode that keeps horses saves it and gives it back with
SetHorseHealth.
Syntax
Section titled “Syntax”GetHorseHealth(id)| Parameter | Type | |
|---|---|---|
id |
number | the horse |
Returns
Section titled “Returns”number | nil - nil when it is not a horse
Example
Section titled “Example”local health = GetHorseHealth(GetPlayerMount(pid))if health and health < 30 then SendClientMessage(pid, 0xFFAA00FF, "Your horse is badly hurt.") endSee also
Section titled “See also”SetHorseHealth · OnHorseDamage · SetHorseInvulnerable · the Horses group of the index
