GetPlayerHorse
The horse the player rides, or else the newest one they control.
Syntax
Section titled “Syntax”GetPlayerHorse(pid)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
Returns
Section titled “Returns”number - a horse’s entity id; nil when they have none
Example
Section titled “Example”-- /horse home: the player's horse comes to themlocal horse = GetPlayerHorse(pid)if horse then local x, y, z = GetPlayerPos(pid) SetEntityPos(horse, x + 2, y, z)endSee also
Section titled “See also”GetPlayerMount · GetEntityController · CreateHorse · the Horses group of the index
