Skip to content

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.

GetHorseHealth(id)
Parameter Type
id number the horse

number | nil - nil when it is not a horse

local health = GetHorseHealth(GetPlayerMount(pid))
if health and health < 30 then SendClientMessage(pid, 0xFFAA00FF, "Your horse is badly hurt.") end

SetHorseHealth · OnHorseDamage · SetHorseInvulnerable · the Horses group of the index