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).
Syntax
Section titled “Syntax”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 |
Returns
Section titled “Returns”boolean - false for an animal or anything but a living server actor
Example
Section titled “Example”-- a city guard in mail with a sword and a shield, and a few coins on himSetActorInventory(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},})See also
Section titled “See also”GiveActorItem · RemoveActorItem · GetActorInventory · SetActorStat · CreateActor · the NPC actors group of the index
