Skip to content

SetActorInventory

Gives an actor exactly these items - what it wears dresses and arms it.

The same list SetPlayerInventory takes: {class = <item>, amount = <n>, worn = true}, a class by its name, id or GUID (at most 64 entries). The items with worn dress and arm the actor’s body on every screen, in place of the clothing and weapon presets it was created with. They are also what the server counts: the armour it wears softens the blows and arrows that hit it, its strongest worn weapon is the one its blows are priced by, and that weapon and its first shield are what it drops when it dies. The rest it only carries - GetActorInventory lists it, for loot. An actor never given items keeps its presets’ dress and weapon, and no armour counts for it. An empty list leaves it naked and unarmed (it punches).

SetActorInventory(id, items)
Parameter Type
id number the actor
items table a list of {class =, amount =, health =, worn =}; amount 1 and health 100 by default

boolean - false for an animal or anything but a living server actor

-- a city guard in mail with a sword and a shield, and a few coins on him
SetActorInventory(guard, {
{class = "MailLong01_m01_C5", worn = true}, {class = "KettleHat01_m01_E1", worn = true},
{class = "longswordCommon", worn = true}, {class = "shieldCuman_01", worn = true},
{class = "money", amount = 12},
})

GiveActorItem · RemoveActorItem · GetActorInventory · SetActorStat · CreateActor · the NPC actors group of the index