OnHorseUnload
The body across a horse came off it - it lies at x, y, z.
reason is one of: "taken down" (a player took it into their carry - their carry starts), "mode" (UnloadHorse, or
StopCarry on the player across it), "horse died", "target died" (a player or an actor across it), "target left",
"moved" (the server moved one of them, or put one of them in another virtual world), "respawned", "mounted", "cart",
"flying", or "destroyed" (the horse or the body was removed). Unless the mode named a place, a body that comes off lies
beside the horse, on its left. When the server put the body nowhere itself - "taken down", or the server moved or lost the
player across the horse - x, y, z is the place the server’s record has at that moment.
Syntax
Section titled “Syntax”function OnHorseUnload(horse, kind, id, reason, x, y, z) -- ...end| Parameter | Type | |
|---|---|---|
horse |
number | the horse’s entity id |
kind |
string | "player", "corpse" or "actor" |
id |
number | the player’s id, or the entity id |
reason |
string | why it came off |
x |
number | metres - where the body lies |
y |
number | metres |
z |
number | metres |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”function OnHorseUnload(horse, kind, id, reason, x, y, z) if kind == "player" and reason == "horse died" then SendClientMessage(id, COLOR_SERVER, "The horse fell and you with it.") endendSee also
Section titled “See also”OnPlayerLoadHorse · OnPlayerUnloadHorse · GetHorseLoad · the Carrying group of the index
