Skip to content

GetPlayerHorse

The horse the player rides, or else the newest one they control.

GetPlayerHorse(pid)
Parameter Type
pid number the player

number - a horse’s entity id; nil when they have none

-- /horse home: the player's horse comes to them
local horse = GetPlayerHorse(pid)
if horse then
local x, y, z = GetPlayerPos(pid)
SetEntityPos(horse, x + 2, y, z)
end

GetPlayerMount · GetEntityController · CreateHorse · the Horses group of the index