Skip to content

GetHorseStats

Every stat a mode set on a horse.

What SetHorseStat gave the horse, by name - the thing to save with a horse a mode keeps. A stat that was never set is not in it; one set to 0 is, with 0 - this is the call that tells the two apart.

GetHorseStats(id)
Parameter Type
id number the horse

table | nil - {strength = 25, courage = 10}; {} when none was set; nil when it is not a horse

local saved = {}
for stat, level in pairs(GetHorseStats(horse) or {}) do saved[#saved + 1] = stat .. "=" .. level end
SetEntityData(horse, "saved_stats", table.concat(saved, ","))

SetHorseStat · GetHorseStat · GetHorseItems · the Horses group of the index