Skip to content

UnhitchHorse

Takes a player’s horse from a cart; it stands beside it again.

The slot is left empty ("none") - give it the cart’s own horse back with SetCartPart and a coat. slot 0 takes the first player’s horse there is.

UnhitchHorse(id [, slot])
Parameter Type
id number the cart
slot number 1, 2, or 0 / nil = the first hitched (optional)

number - the horse, standing beside the cart; nil when no player’s horse was there

local horse = UnhitchHorse(cart, 1)
if horse then SetCartPart(cart, "horse1", "chestnut") end -- the cart's own horse again

HitchHorse · the Carts group of the index